From 0e4ad7185ebeb41ee3cbfeb1d14ca5fc8ddbcf6b Mon Sep 17 00:00:00 2001 From: Mihai-Cristian Condrea Date: Sat, 20 Sep 2025 12:07:19 +0300 Subject: [PATCH 1/6] Refine help screen edge-to-edge layout --- .../java/ui/screens/help/HelpActivity.java | 32 +++++- app/src/main/res/layout/activity_help.xml | 101 +++++++++++------- 2 files changed, 95 insertions(+), 38 deletions(-) diff --git a/app/src/main/java/com/d4rk/androidtutorials/java/ui/screens/help/HelpActivity.java b/app/src/main/java/com/d4rk/androidtutorials/java/ui/screens/help/HelpActivity.java index 40e9849c..78a63a7e 100644 --- a/app/src/main/java/com/d4rk/androidtutorials/java/ui/screens/help/HelpActivity.java +++ b/app/src/main/java/com/d4rk/androidtutorials/java/ui/screens/help/HelpActivity.java @@ -6,12 +6,17 @@ import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; +import android.view.View; +import android.view.ViewGroup; +import android.widget.FrameLayout; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.lifecycle.ViewModelProvider; import androidx.preference.Preference; import androidx.preference.PreferenceFragmentCompat; +import androidx.recyclerview.widget.RecyclerView; import com.d4rk.androidtutorials.java.BuildConfig; import com.d4rk.androidtutorials.java.R; @@ -38,7 +43,9 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ActivityHelpBinding binding = ActivityHelpBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); - EdgeToEdgeDelegate.apply(this, binding.getRoot()); + setSupportActionBar(binding.topAppBar); + binding.topAppBar.setNavigationOnClickListener(v -> getOnBackPressedDispatcher().onBackPressed()); + EdgeToEdgeDelegate.apply(this, binding.helpContainer); AdUtils.loadBanner(binding.faqNativeAd); helpViewModel = new ViewModelProvider(this).get(HelpViewModel.class); new FastScrollerBuilder(binding.scrollContainer) @@ -126,6 +133,29 @@ public static class FaqFragment extends PreferenceFragmentCompat { public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { setPreferencesFromResource(R.xml.preferences_faq, rootKey); } + + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + RecyclerView listView = getListView(); + listView.setNestedScrollingEnabled(false); + listView.setOverScrollMode(View.OVER_SCROLL_NEVER); + listView.setClipToPadding(false); + + ViewGroup.LayoutParams layoutParams = listView.getLayoutParams(); + FrameLayout.LayoutParams frameLayoutParams; + if (layoutParams instanceof FrameLayout.LayoutParams) { + frameLayoutParams = (FrameLayout.LayoutParams) layoutParams; + } else { + frameLayoutParams = new FrameLayout.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.WRAP_CONTENT + ); + } + frameLayoutParams.height = ViewGroup.LayoutParams.WRAP_CONTENT; + frameLayoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT; + listView.setLayoutParams(frameLayoutParams); + } } public static class FeedbackFragment extends PreferenceFragmentCompat { diff --git a/app/src/main/res/layout/activity_help.xml b/app/src/main/res/layout/activity_help.xml index 8b2b2464..0a1684fb 100644 --- a/app/src/main/res/layout/activity_help.xml +++ b/app/src/main/res/layout/activity_help.xml @@ -1,55 +1,82 @@ - - + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:title="@string/help" /> - + - + android:orientation="vertical" + android:paddingHorizontal="24dp" + android:paddingTop="24dp" + android:paddingBottom="32dp"> + + - - + + - - + android:layout_height="wrap_content" + android:orientation="vertical" + android:padding="16dp"> - + + + - + + + + + + - - \ No newline at end of file + From 20b2c0c33074dc9090cb42d8f10d7d0aa9b8ec74 Mon Sep 17 00:00:00 2001 From: Mihai-Cristian Condrea Date: Sat, 20 Sep 2025 13:47:42 +0300 Subject: [PATCH 2/6] Rework help FAQ into single scroll list --- .../java/ui/screens/help/HelpActivity.java | 111 ++++++++++++------ app/src/main/res/layout/activity_help.xml | 43 +++---- app/src/main/res/layout/item_help_faq.xml | 29 +++++ app/src/main/res/xml/preferences_faq.xml | 57 --------- docs/screens/help.md | 6 +- 5 files changed, 118 insertions(+), 128 deletions(-) create mode 100644 app/src/main/res/layout/item_help_faq.xml delete mode 100644 app/src/main/res/xml/preferences_faq.xml diff --git a/app/src/main/java/com/d4rk/androidtutorials/java/ui/screens/help/HelpActivity.java b/app/src/main/java/com/d4rk/androidtutorials/java/ui/screens/help/HelpActivity.java index 78a63a7e..76b9c6af 100644 --- a/app/src/main/java/com/d4rk/androidtutorials/java/ui/screens/help/HelpActivity.java +++ b/app/src/main/java/com/d4rk/androidtutorials/java/ui/screens/help/HelpActivity.java @@ -4,14 +4,18 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; +import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; -import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.appcompat.widget.LinearLayoutCompat; + +import androidx.annotation.NonNull; +import androidx.annotation.StringRes; import androidx.appcompat.app.AlertDialog; import androidx.lifecycle.ViewModelProvider; import androidx.preference.Preference; @@ -23,9 +27,9 @@ import com.d4rk.androidtutorials.java.ads.AdUtils; import com.d4rk.androidtutorials.java.databinding.ActivityHelpBinding; import com.d4rk.androidtutorials.java.databinding.DialogVersionInfoBinding; +import com.d4rk.androidtutorials.java.databinding.ItemHelpFaqBinding; import com.d4rk.androidtutorials.java.ui.components.navigation.BaseActivity; import com.d4rk.androidtutorials.java.ui.screens.help.repository.HelpRepository; -import com.d4rk.androidtutorials.java.utils.EdgeToEdgeDelegate; import com.d4rk.androidtutorials.java.utils.OpenSourceLicensesUtils; import com.google.android.material.snackbar.Snackbar; import com.google.android.play.core.review.ReviewInfo; @@ -33,27 +37,36 @@ import dagger.hilt.android.AndroidEntryPoint; import me.zhanghai.android.fastscroll.FastScrollerBuilder; +import java.util.Arrays; +import java.util.List; + @AndroidEntryPoint public class HelpActivity extends BaseActivity { private HelpViewModel helpViewModel; + private static final List FAQ_ITEMS = Arrays.asList( + new FaqItem(R.string.question_1, R.string.summary_preference_faq_1), + new FaqItem(R.string.question_2, R.string.summary_preference_faq_2), + new FaqItem(R.string.question_3, R.string.summary_preference_faq_3), + new FaqItem(R.string.question_4, R.string.summary_preference_faq_4), + new FaqItem(R.string.question_5, R.string.summary_preference_faq_5), + new FaqItem(R.string.question_6, R.string.summary_preference_faq_6), + new FaqItem(R.string.question_7, R.string.summary_preference_faq_7), + new FaqItem(R.string.question_8, R.string.summary_preference_faq_8), + new FaqItem(R.string.question_9, R.string.summary_preference_faq_9) + ); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ActivityHelpBinding binding = ActivityHelpBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); - setSupportActionBar(binding.topAppBar); - binding.topAppBar.setNavigationOnClickListener(v -> getOnBackPressedDispatcher().onBackPressed()); - EdgeToEdgeDelegate.apply(this, binding.helpContainer); AdUtils.loadBanner(binding.faqNativeAd); helpViewModel = new ViewModelProvider(this).get(HelpViewModel.class); - new FastScrollerBuilder(binding.scrollContainer) + new FastScrollerBuilder(binding.scrollView) .useMd2Style() .build(); - getSupportFragmentManager().beginTransaction() - .replace(R.id.frame_layout_faq, new FaqFragment()) - .commit(); + bindFaqItems(binding); getSupportFragmentManager().beginTransaction() .replace(R.id.frame_layout_feedback, new FeedbackFragment()) @@ -128,36 +141,6 @@ private void openLink(String url) { startActivity(browserIntent); } - public static class FaqFragment extends PreferenceFragmentCompat { - @Override - public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { - setPreferencesFromResource(R.xml.preferences_faq, rootKey); - } - - @Override - public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { - super.onViewCreated(view, savedInstanceState); - RecyclerView listView = getListView(); - listView.setNestedScrollingEnabled(false); - listView.setOverScrollMode(View.OVER_SCROLL_NEVER); - listView.setClipToPadding(false); - - ViewGroup.LayoutParams layoutParams = listView.getLayoutParams(); - FrameLayout.LayoutParams frameLayoutParams; - if (layoutParams instanceof FrameLayout.LayoutParams) { - frameLayoutParams = (FrameLayout.LayoutParams) layoutParams; - } else { - frameLayoutParams = new FrameLayout.LayoutParams( - ViewGroup.LayoutParams.MATCH_PARENT, - ViewGroup.LayoutParams.WRAP_CONTENT - ); - } - frameLayoutParams.height = ViewGroup.LayoutParams.WRAP_CONTENT; - frameLayoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT; - listView.setLayoutParams(frameLayoutParams); - } - } - public static class FeedbackFragment extends PreferenceFragmentCompat { @Override @@ -187,6 +170,29 @@ public void onFailure(Exception e) { } } + @Override + public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + RecyclerView listView = getListView(); + listView.setNestedScrollingEnabled(false); + listView.setOverScrollMode(View.OVER_SCROLL_NEVER); + listView.setClipToPadding(false); + + ViewGroup.LayoutParams layoutParams = listView.getLayoutParams(); + FrameLayout.LayoutParams frameLayoutParams; + if (layoutParams instanceof FrameLayout.LayoutParams) { + frameLayoutParams = (FrameLayout.LayoutParams) layoutParams; + } else { + frameLayoutParams = new FrameLayout.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.WRAP_CONTENT + ); + } + frameLayoutParams.height = ViewGroup.LayoutParams.WRAP_CONTENT; + frameLayoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT; + listView.setLayoutParams(frameLayoutParams); + } + private void launchGooglePlayReviews() { Uri uri = Uri.parse("https://play.google.com/store/apps/details?id=" + requireActivity().getPackageName() + "&showAllReviews=true"); Intent intent = new Intent(Intent.ACTION_VIEW, uri); @@ -201,4 +207,31 @@ private void launchGooglePlayReviews() { } } } + + private void bindFaqItems(ActivityHelpBinding binding) { + LinearLayoutCompat faqList = binding.faqList; + faqList.removeAllViews(); + LayoutInflater inflater = LayoutInflater.from(this); + + for (int i = 0; i < FAQ_ITEMS.size(); i++) { + FaqItem item = FAQ_ITEMS.get(i); + ItemHelpFaqBinding itemBinding = ItemHelpFaqBinding.inflate(inflater, faqList, false); + itemBinding.question.setText(item.questionResId); + itemBinding.answer.setText(item.answerResId); + itemBinding.divider.setVisibility(i == FAQ_ITEMS.size() - 1 ? View.GONE : View.VISIBLE); + faqList.addView(itemBinding.getRoot()); + } + } + + private static final class FaqItem { + @StringRes + private final int questionResId; + @StringRes + private final int answerResId; + + private FaqItem(@StringRes int questionResId, @StringRes int answerResId) { + this.questionResId = questionResId; + this.answerResId = answerResId; + } + } } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_help.xml b/app/src/main/res/layout/activity_help.xml index 0a1684fb..3cfcd046 100644 --- a/app/src/main/res/layout/activity_help.xml +++ b/app/src/main/res/layout/activity_help.xml @@ -2,44 +2,33 @@ - - + app:layout_constraintTop_toTopOf="parent"> - @@ -51,17 +40,12 @@ android:layout_marginBottom="24dp" app:shapeAppearance="@style/ShapeAppearanceOverlay.CardViewTopRoundedFilled"> - - - - + android:padding="16dp" /> - + + diff --git a/app/src/main/res/layout/item_help_faq.xml b/app/src/main/res/layout/item_help_faq.xml new file mode 100644 index 00000000..8c5cb923 --- /dev/null +++ b/app/src/main/res/layout/item_help_faq.xml @@ -0,0 +1,29 @@ + + + + + + + + + + diff --git a/app/src/main/res/xml/preferences_faq.xml b/app/src/main/res/xml/preferences_faq.xml deleted file mode 100644 index 21c7df79..00000000 --- a/app/src/main/res/xml/preferences_faq.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/screens/help.md b/docs/screens/help.md index 3e6c7223..cd7c4c55 100644 --- a/docs/screens/help.md +++ b/docs/screens/help.md @@ -4,9 +4,9 @@ The Help screen provides users with access to frequently asked questions (FAQs), options to submit feedback, and links to important information like the app's privacy policy, terms of service, and open-source licenses. ## Structure -The Help screen is implemented as an `Activity` that hosts different sections using `PreferenceFragmentCompat`: -- **`HelpActivity`**: The main activity for this screen. It manages the layout and hosts the fragments. -- **`FaqFragment`**: Displays a list of frequently asked questions, loaded from `R.xml.preferences_faq`. +The Help screen is implemented as an `Activity` that composes different sections: +- **`HelpActivity`**: The main activity for this screen. It manages the layout, renders the FAQ list, and hosts the feedback fragment. +- **FAQ list**: Built dynamically inside the activity by inflating a shared item layout for each question/answer pair. - **`FeedbackFragment`**: Contains preferences related to user feedback, including an option to rate the app. This is loaded from `R.xml.preferences_feedback`. ## Features From 7e9aeb0e6067c060e901be511bf9b553a067ce7d Mon Sep 17 00:00:00 2001 From: Mihai-Cristian Condrea Date: Sat, 20 Sep 2025 14:13:04 +0300 Subject: [PATCH 3/6] Make help FAQ items expandable --- .../java/ui/screens/help/HelpActivity.java | 22 +++++++++- .../main/res/drawable/ic_expand_more_24.xml | 10 +++++ app/src/main/res/layout/item_help_faq.xml | 40 +++++++++++++++---- app/src/main/res/values/strings.xml | 2 + docs/screens/help.md | 2 +- 5 files changed, 65 insertions(+), 11 deletions(-) create mode 100644 app/src/main/res/drawable/ic_expand_more_24.xml diff --git a/app/src/main/java/com/d4rk/androidtutorials/java/ui/screens/help/HelpActivity.java b/app/src/main/java/com/d4rk/androidtutorials/java/ui/screens/help/HelpActivity.java index 76b9c6af..467d4976 100644 --- a/app/src/main/java/com/d4rk/androidtutorials/java/ui/screens/help/HelpActivity.java +++ b/app/src/main/java/com/d4rk/androidtutorials/java/ui/screens/help/HelpActivity.java @@ -12,11 +12,11 @@ import android.widget.FrameLayout; import androidx.annotation.Nullable; -import androidx.appcompat.widget.LinearLayoutCompat; - import androidx.annotation.NonNull; import androidx.annotation.StringRes; import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.widget.LinearLayoutCompat; +import androidx.core.view.ViewCompat; import androidx.lifecycle.ViewModelProvider; import androidx.preference.Preference; import androidx.preference.PreferenceFragmentCompat; @@ -218,11 +218,29 @@ private void bindFaqItems(ActivityHelpBinding binding) { ItemHelpFaqBinding itemBinding = ItemHelpFaqBinding.inflate(inflater, faqList, false); itemBinding.question.setText(item.questionResId); itemBinding.answer.setText(item.answerResId); + itemBinding.answer.setVisibility(View.GONE); + itemBinding.toggleIcon.setRotation(0f); + itemBinding.questionContainer.setContentDescription(itemBinding.question.getText()); + ViewCompat.setStateDescription(itemBinding.questionContainer, getString(R.string.faq_state_collapsed)); + itemBinding.questionContainer.setOnClickListener(v -> toggleFaqItem(itemBinding)); itemBinding.divider.setVisibility(i == FAQ_ITEMS.size() - 1 ? View.GONE : View.VISIBLE); faqList.addView(itemBinding.getRoot()); } } + private void toggleFaqItem(ItemHelpFaqBinding binding) { + boolean expand = binding.answer.getVisibility() != View.VISIBLE; + binding.answer.setVisibility(expand ? View.VISIBLE : View.GONE); + float rotation = expand ? 180f : 0f; + binding.toggleIcon.animate().cancel(); + binding.toggleIcon.animate() + .rotation(rotation) + .setDuration(200L) + .start(); + ViewCompat.setStateDescription(binding.questionContainer, + getString(expand ? R.string.faq_state_expanded : R.string.faq_state_collapsed)); + } + private static final class FaqItem { @StringRes private final int questionResId; diff --git a/app/src/main/res/drawable/ic_expand_more_24.xml b/app/src/main/res/drawable/ic_expand_more_24.xml new file mode 100644 index 00000000..3ac98a5e --- /dev/null +++ b/app/src/main/res/drawable/ic_expand_more_24.xml @@ -0,0 +1,10 @@ + + + + diff --git a/app/src/main/res/layout/item_help_faq.xml b/app/src/main/res/layout/item_help_faq.xml index 8c5cb923..477e31f4 100644 --- a/app/src/main/res/layout/item_help_faq.xml +++ b/app/src/main/res/layout/item_help_faq.xml @@ -3,27 +3,51 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical" - android:paddingVertical="16dp"> + android:orientation="vertical"> - + android:background="?attr/selectableItemBackground" + android:clickable="true" + android:focusable="true" + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingVertical="12dp"> + + + + + + + android:textAppearance="@style/TextAppearance.Material3.BodyMedium" + android:visibility="gone" /> + android:layout_marginTop="12dp" /> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 33b9b18e..41e01b8f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -338,6 +338,8 @@ You can disable Firebase analytics and crashlytics by going to the settings menu in the app and toggle the switch for these features. You can check for updates to Android Studio Tutorials: Java Edition by going to the settings menu in the app and selecting the \"Check for updates\" option. You can support the development of Android Studio Tutorials: Java Edition by leaving a positive review on the Google Play Store, sharing the app with friends and colleagues, and supporting the developers through the \"Share\" option in the settings menu. + Collapsed + Expanded Allows the app to retrieve and use the advertising identifier associated with the user\'s device, providing personalized ads, measuring ad effectiveness, and showing ads on Android 13 or later devices. Allows the app to establish an internet connection to send error reports or check for updates. Allows the app to display notifications on the devices with Android 13 or later. diff --git a/docs/screens/help.md b/docs/screens/help.md index cd7c4c55..7dbbcc5a 100644 --- a/docs/screens/help.md +++ b/docs/screens/help.md @@ -11,7 +11,7 @@ The Help screen is implemented as an `Activity` that composes different sections ## Features The Help screen offers the following functionalities, accessible primarily through an options menu: -- **View FAQs**: Users can browse a list of common questions and answers. +- **View FAQs**: Users can browse a list of common questions and answers, expanding items on demand to reveal the detailed responses. - **Provide Feedback**: Users can initiate a review flow or be directed to the Google Play Store to leave a review. - **View in Google Play**: Opens the app's listing on the Google Play Store. - **Version Info**: Displays a dialog with the app's name, version, and copyright information. From 2b2a75ec1fe4d7090307e38b364c9f239c40e7fd Mon Sep 17 00:00:00 2001 From: Mihai-Cristian Condrea Date: Sat, 20 Sep 2025 14:33:48 +0300 Subject: [PATCH 4/6] Make help FAQ cards fully clickable --- .../java/ui/screens/help/HelpActivity.java | 17 ++- app/src/main/res/layout/activity_help.xml | 7 +- app/src/main/res/layout/ad_help.xml | 2 +- app/src/main/res/layout/item_help_faq.xml | 101 +++++++++++------- 4 files changed, 80 insertions(+), 47 deletions(-) diff --git a/app/src/main/java/com/d4rk/androidtutorials/java/ui/screens/help/HelpActivity.java b/app/src/main/java/com/d4rk/androidtutorials/java/ui/screens/help/HelpActivity.java index 467d4976..63ecde06 100644 --- a/app/src/main/java/com/d4rk/androidtutorials/java/ui/screens/help/HelpActivity.java +++ b/app/src/main/java/com/d4rk/androidtutorials/java/ui/screens/help/HelpActivity.java @@ -220,9 +220,16 @@ private void bindFaqItems(ActivityHelpBinding binding) { itemBinding.answer.setText(item.answerResId); itemBinding.answer.setVisibility(View.GONE); itemBinding.toggleIcon.setRotation(0f); - itemBinding.questionContainer.setContentDescription(itemBinding.question.getText()); + CharSequence questionText = itemBinding.question.getText(); + itemBinding.getRoot().setContentDescription(questionText); + itemBinding.questionContainer.setContentDescription(questionText); + ViewCompat.setStateDescription(itemBinding.getRoot(), getString(R.string.faq_state_collapsed)); ViewCompat.setStateDescription(itemBinding.questionContainer, getString(R.string.faq_state_collapsed)); - itemBinding.questionContainer.setOnClickListener(v -> toggleFaqItem(itemBinding)); + + View.OnClickListener toggleListener = v -> toggleFaqItem(itemBinding); + itemBinding.getRoot().setOnClickListener(toggleListener); + itemBinding.questionContainer.setOnClickListener(toggleListener); + itemBinding.toggleIcon.setOnClickListener(toggleListener); itemBinding.divider.setVisibility(i == FAQ_ITEMS.size() - 1 ? View.GONE : View.VISIBLE); faqList.addView(itemBinding.getRoot()); } @@ -237,8 +244,10 @@ private void toggleFaqItem(ItemHelpFaqBinding binding) { .rotation(rotation) .setDuration(200L) .start(); - ViewCompat.setStateDescription(binding.questionContainer, - getString(expand ? R.string.faq_state_expanded : R.string.faq_state_collapsed)); + int stateRes = expand ? R.string.faq_state_expanded : R.string.faq_state_collapsed; + CharSequence stateDescription = getString(stateRes); + ViewCompat.setStateDescription(binding.getRoot(), stateDescription); + ViewCompat.setStateDescription(binding.questionContainer, stateDescription); } private static final class FaqItem { diff --git a/app/src/main/res/layout/activity_help.xml b/app/src/main/res/layout/activity_help.xml index 3cfcd046..7c0bb058 100644 --- a/app/src/main/res/layout/activity_help.xml +++ b/app/src/main/res/layout/activity_help.xml @@ -37,15 +37,14 @@ style="@style/Widget.Material3.CardView.Filled" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="24dp" - app:shapeAppearance="@style/ShapeAppearanceOverlay.CardViewTopRoundedFilled"> + android:layout_marginBottom="2dp" + app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.CardViewTopRoundedFilled"> + android:orientation="vertical" /> + app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.CardViewBottomRoundedFilled"> - + android:layout_marginHorizontal="0dp" + android:layout_marginVertical="4dp" + android:animateLayoutChanges="true" + android:clickable="true" + android:focusable="true" + android:foreground="?attr/selectableItemBackground" + app:cardBackgroundColor="@android:color/transparent" + app:cardCornerRadius="12dp" + app:cardElevation="0dp" + app:strokeWidth="0dp"> + android:animateLayoutChanges="true" + android:orientation="vertical"> - + android:clickable="true" + android:clipToOutline="true" + android:focusable="true" + android:foreground="?attr/selectableItemBackground" + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingHorizontal="12dp" + android:paddingVertical="12dp" + tools:targetApi="31"> - + - + + - + - + - + + From f5bd6df489a7e68e3227bad13c16113477e8a0a0 Mon Sep 17 00:00:00 2001 From: D4rK7355608 Date: Sat, 20 Sep 2025 14:38:25 +0300 Subject: [PATCH 5/6] Refactor AboutFragment layout This commit refactors `fragment_about.xml` by: - Replacing the root `ConstraintLayout` with a `LinearLayoutCompat` for simpler vertical arrangement. - Setting `android:fillViewport="true"` on the `FastScrollScrollView`. - Adding `android:animateLayoutChanges="true"` to the `MaterialCardView`. - Grouping chips into nested `LinearLayoutCompat` containers for better organization. - Removing explicit `app:layout_constraintTop_toTopOf` and similar constraints, relying on the `LinearLayoutCompat`'s orientation. --- app/src/main/res/layout/fragment_about.xml | 237 ++++++++++----------- 1 file changed, 113 insertions(+), 124 deletions(-) diff --git a/app/src/main/res/layout/fragment_about.xml b/app/src/main/res/layout/fragment_about.xml index 4c47e643..566719e1 100644 --- a/app/src/main/res/layout/fragment_about.xml +++ b/app/src/main/res/layout/fragment_about.xml @@ -4,26 +4,31 @@ xmlns:tools="http://schemas.android.com/tools" android:id="@+id/scroll_view" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:fillViewport="true"> - + android:orientation="vertical" + android:paddingHorizontal="24dp" + android:paddingVertical="24dp"> - + android:layout_height="wrap_content" + android:gravity="center_horizontal" + android:orientation="vertical"> + android:textStyle="bold" /> - - + android:text="@string/app_version" /> - - - - - - - + + + + + + + - - + + + + + + + - + android:layout_marginTop="8dp" + android:gravity="center" + android:orientation="horizontal"> + + + + + + @@ -189,26 +183,21 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="24dp" - android:src="@drawable/il_about" - app:layout_constraintTop_toBottomOf="@id/animation_about" /> + android:src="@drawable/il_about" /> + android:text="@string/made_in" /> - - + android:layout_gravity="center_horizontal" + android:text="@string/copyright" /> + + \ No newline at end of file From 3e10c79396e13ff3c8f321cd9af4c1e443b42a71 Mon Sep 17 00:00:00 2001 From: D4rK7355608 Date: Sat, 20 Sep 2025 14:39:40 +0300 Subject: [PATCH 6/6] Remove unnecessary flags from build command in CI The `--stacktrace` and `--info` flags were removed from the `./gradlew build` command in the `android.yml` workflow file. --- .github/workflows/android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index e5606174..661b6310 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -24,4 +24,4 @@ jobs: run: chmod +x gradlew - name: Build & run all tests - run: ./gradlew build --stacktrace --info \ No newline at end of file + run: ./gradlew build \ No newline at end of file