Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #3972: Added TextViewStyleCheck script #5599

Open
wants to merge 54 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
e243e20
adding text view style check script
manas-yu Dec 16, 2024
00f7367
formatting
manas-yu Dec 16, 2024
25e31c0
error print fix
manas-yu Dec 16, 2024
0e7240c
Merge branch 'develop' into text-view-script
manas-yu Dec 17, 2024
8afffd9
Merge branch 'develop' into text-view-script
manas-yu Dec 20, 2024
0cda3ff
Merge branch 'develop' into text-view-script
manas-yu Dec 23, 2024
ecb097e
Merge branch 'develop' into text-view-script
manas-yu Dec 27, 2024
b3247dd
Merge branch 'develop' into text-view-script
manas-yu Dec 29, 2024
284759b
Merge branch 'develop' into text-view-script
manas-yu Dec 30, 2024
50155ab
edge cases
manas-yu Jan 8, 2025
781d682
formatting
manas-yu Jan 8, 2025
d66f9aa
Merge branch 'text-view-script' of https://github.com/manas-yu/oppia-…
manas-yu Jan 8, 2025
8b1f90f
class fix
manas-yu Jan 8, 2025
b5155bd
removing redundant checks
manas-yu Jan 8, 2025
0631ec7
checking style
manas-yu Jan 8, 2025
f104b96
kdoc fix
manas-yu Jan 8, 2025
8bd90bf
logging line no. and CI integration
manas-yu Jan 10, 2025
9e530aa
formatting
manas-yu Jan 10, 2025
051ab79
Merge branch 'develop' into text-view-script
manas-yu Jan 10, 2025
0510d7d
test file
manas-yu Jan 10, 2025
f24b7f6
Merge branch 'text-view-script' of https://github.com/manas-yu/oppia-…
manas-yu Jan 10, 2025
ec4c12d
bazel setup
manas-yu Jan 10, 2025
67ab290
revert
manas-yu Jan 10, 2025
afcb708
avoid redundant RTL/LTR settings checks
manas-yu Jan 10, 2025
b5d50a8
Merge branch 'develop' into text-view-script
manas-yu Jan 15, 2025
6caa1a9
Merge branch 'oppia:develop' into text-view-script
manas-yu Jan 15, 2025
992e644
revert
manas-yu Jan 15, 2025
73c90aa
adding ids
manas-yu Jan 15, 2025
7670404
updating tests
manas-yu Jan 15, 2025
5f7c85d
formatting
manas-yu Jan 15, 2025
ca14146
adding style
manas-yu Jan 16, 2025
8602e7e
kdoc and todo exemp
manas-yu Jan 16, 2025
e8ad25c
line number
manas-yu Jan 17, 2025
2fb3eff
formatting
manas-yu Jan 17, 2025
6e76303
attri list
manas-yu Jan 17, 2025
c80cfe9
kdoc
manas-yu Jan 17, 2025
4bdbe27
Deque and line no
manas-yu Jan 19, 2025
72e30eb
formatting
manas-yu Jan 19, 2025
1e0a43f
Merge branch 'develop' into text-view-script
manas-yu Jan 21, 2025
9917fad
Merge branch 'develop' into text-view-script
manas-yu Jan 22, 2025
250a24a
Merge branch 'develop' into text-view-script
manas-yu Jan 22, 2025
c26d301
TODO and idInformation
manas-yu Jan 22, 2025
8a77278
formatting
manas-yu Jan 22, 2025
cf97591
foramtting
manas-yu Jan 22, 2025
1a7eb37
idinfo logging
manas-yu Jan 22, 2025
0a02b75
renaming
manas-yu Jan 22, 2025
e727eab
Merge branch 'develop' into text-view-script
manas-yu Jan 22, 2025
4ccf308
formatting
manas-yu Jan 22, 2025
62ac584
formatting
manas-yu Jan 22, 2025
e82e479
Merge branch 'text-view-script' of github.com:manas-yu/oppia-android …
manas-yu Jan 22, 2025
a82826d
Merge branch 'develop' into text-view-script
manas-yu Jan 22, 2025
c9af6ad
exception handling
manas-yu Jan 22, 2025
e32a8d3
Merge branch 'text-view-script' of github.com:manas-yu/oppia-android …
manas-yu Jan 22, 2025
7e7b863
adding id attributes
manas-yu Jan 23, 2025
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
7 changes: 7 additions & 0 deletions .github/workflows/static_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ jobs:
run: |
bazel run //scripts:xml_syntax_check -- $(pwd)

- name: TextView Style Validation Check
# The expression if: ${{ !cancelled() }} runs a job or step regardless of its success or failure while responding to cancellations,
# serving as a cancellation-compliant alternative to if: ${{ always() }} in concurrent workflows.
if: ${{ !cancelled() }}
run: |
bazel run //scripts:check_textview_styles -- $(pwd)

- name: Testfile Presence Check
# The expression if: ${{ !cancelled() }} runs a job or step regardless of its success or failure while responding to cancellations,
# serving as a cancellation-compliant alternative to if: ${{ always() }} in concurrent workflows.
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/layout-land/profile_chooser_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
android:contentDescription="@string/language_icon_content_description" />

<TextView
android:id="@+id/profile_chooser_language_text_view"
style="@style/Subtitle1ViewCenter"
android:minHeight="48dp"
android:paddingTop="20dp"
Expand Down Expand Up @@ -100,6 +101,7 @@
app:layout_constraintEnd_toEndOf="parent">

<TextView
android:id="@+id/administrator_controls_text_view"
style="@style/Subtitle1ViewCenter"
android:layout_marginBottom="24dp"
android:minHeight="48dp"
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/layout-land/walkthrough_final_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
app:contentPadding="@dimen/walkthrough_final_fragment_card_content_padding">

<TextView
android:id="@+id/walkthrough_final_no_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
Expand All @@ -61,6 +62,7 @@
android:textSize="20sp" />

<TextView
android:id="@+id/walkthrough_final_no_center_text_view"
style="@style/TextViewCenter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -85,6 +87,7 @@
app:contentPadding="@dimen/walkthrough_final_fragment_card_content_padding">

<TextView
android:id="@+id/walkthrough_final_yes_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
Expand All @@ -94,6 +97,7 @@
android:textSize="20sp" />

<TextView
android:id="@+id/walkthrough_final_yes_center_text_view"
style="@style/TextViewCenter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
</FrameLayout>

<TextView
android:id="@+id/story_progress_percentage_text_view"
style="@style/TextViewCenterHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
android:contentDescription="@string/language_icon_content_description" />

<TextView
android:id="@+id/profile_chooser_language_text_view"
style="@style/Subtitle1ViewCenter"
android:minHeight="48dp"
android:paddingTop="20dp"
Expand Down Expand Up @@ -108,6 +109,7 @@
app:layout_constraintEnd_toEndOf="parent">

<TextView
android:id="@+id/administrator_controls_text_view"
style="@style/Heading1ViewCenter"
android:layout_marginBottom="@dimen/profile_chooser_administrator_controls_margin_bottom"
android:minHeight="48dp"
Expand Down
11 changes: 4 additions & 7 deletions app/src/main/res/layout/drawer_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
android:contentDescription="@string/developer_options_icon_content_description" />

<TextView
android:id="@+id/developer_options_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
Expand Down Expand Up @@ -103,14 +104,10 @@
android:contentDescription="@string/administrator_controls_icon_content_description" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="12dp"
android:fontFamily="sans-serif-medium"
android:id="@+id/administrator_controls_text_view"
Rd4dev marked this conversation as resolved.
Show resolved Hide resolved
style="@style/AdministratorControlsText"
android:text="@string/administrator_controls"
android:textColor="@{footerViewModel.isAdministratorControlsSelected ? @color/component_color_drawer_fragment_admin_controls_selected_text_color : @color/component_color_shared_primary_dark_text_color}"
android:textSize="14sp" />
android:textColor="@{footerViewModel.isAdministratorControlsSelected ? @color/component_color_drawer_fragment_admin_controls_selected_text_color : @color/component_color_shared_primary_dark_text_color}" />
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
app:textChangedListener="@{viewModel.answerTextWatcher}" />

<TextView
android:id="@+id/numeric_input_interaction_text_view"
style="@style/InputInteractionErrorTextView"
android:text="@{viewModel.errorMessage}"
android:textColor="@color/component_color_shared_input_error_color"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/layout/profile_chooser_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
android:contentDescription="@string/language_icon_content_description" />

<TextView
android:id="@+id/profile_chooser_language_text_view"
style="@style/Subtitle1ViewCenter"
android:minHeight="48dp"
android:paddingTop="20dp"
Expand Down Expand Up @@ -100,6 +101,7 @@
app:layout_constraintEnd_toEndOf="parent">

<TextView
android:id="@+id/administrator_controls_text_view"
style="@style/Subtitle1ViewCenter"
android:layout_marginBottom="24dp"
android:minHeight="48dp"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/topic_lessons_story_summary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
</FrameLayout>

<TextView
android:id="@+id/story_progress_percentage_text_view"
style="@style/TextViewCenterHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/layout/walkthrough_final_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
app:contentPadding="@dimen/walkthrough_final_fragment_card_content_padding">

<TextView
android:id="@+id/walkthrough_final_no_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
Expand All @@ -66,6 +67,7 @@
android:textSize="20sp" />

<TextView
android:id="@+id/walkthrough_final_no_center_text_view"
style="@style/TextViewCenter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -90,6 +92,7 @@
app:contentPadding="@dimen/walkthrough_final_fragment_card_content_padding">

<TextView
android:id="@+id/walkthrough_final_yes_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
Expand All @@ -99,6 +102,7 @@
android:textSize="20sp" />

<TextView
android:id="@+id/walkthrough_final_yes_center_text_view"
style="@style/TextViewCenter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,15 @@
<item name="android:textSize">@dimen/onboarding_shared_text_size_large</item>
</style>

<style name="AdministratorControlsText">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_gravity">center_vertical</item>
<item name="android:layout_marginStart">12dp</item>
<item name="android:fontFamily">sans-serif-medium</item>
<item name="android:textSize">14sp</item>
</style>

<style name="LanguageDropdownStyle" parent="Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
Expand Down
7 changes: 7 additions & 0 deletions scripts/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -312,3 +312,10 @@ java_binary(
main_class = "org.oppia.android.scripts.telemetry.DecodeUserStudyEventStringKt",
runtime_deps = ["//scripts/src/java/org/oppia/android/scripts/telemetry:decode_user_study_event_string_lib"],
)

kt_jvm_binary(
name = "check_textview_styles",
testonly = True,
main_class = "org.oppia.android.scripts.xml.TextViewStyleCheckKt",
runtime_deps = ["//scripts/src/java/org/oppia/android/scripts/xml:check_textview_styles"],
)
2 changes: 1 addition & 1 deletion scripts/assets/todo_open_exemptions.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ todo_open_exemption {
}
todo_open_exemption {
exempted_file_path: "scripts/static_checks.sh"
line_number: 114
line_number: 121
}
todo_open_exemption {
exempted_file_path: "wiki/Coding-style-guide.md"
Expand Down
11 changes: 11 additions & 0 deletions scripts/src/java/org/oppia/android/scripts/xml/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,14 @@ kt_jvm_library(
"//scripts/src/java/org/oppia/android/scripts/common:repository_file",
],
)

kt_jvm_library(
name = "check_textview_styles",
testonly = True,
srcs = ["TextViewStyleCheck.kt"],
visibility = ["//scripts:oppia_script_binary_visibility"],
deps = [
":xml_syntax_error_handler",
"//scripts/src/java/org/oppia/android/scripts/common:repository_file",
],
)
Loading
Loading