Files
AnabasisChatManager-android/app/src/main/res/layout/activity_main.xml
benya 098828d8d5 feat: Повышение стабильности приложения, обновление зависимостей и доработка интерфейса
Этот коммит включает ряд улучшений по всему приложению:

Стабильность:
- Реализована null-безопасность для getArguments() в ChatListFragment, чтобы предотвратить NullPointerException.
- Устранено предупреждение о непроверенном приведении типов в ChatListFragment с использованием @SuppressWarnings("unchecked").
- Обеспечено корректное управление ресурсами: объект Response в VkApiClient обёрнут в try-with-resources для предотвращения утечек ресурсов.

Управление зависимостями:
- Проект обновлён до Java 17 для повышения производительности и использования современных возможностей языка.
- Все прямые объявления зависимостей перенесены в Gradle Version Catalog (libs.versions.toml) для лучшей организации и упрощённого управления внешними библиотеками.

Пользовательский интерфейс:
- Улучшено визуальное отображение ViewPager2 в activity_main.xml путём добавления горизонтальных отступов для более сбалансированного макета.
- В MultiLinkDialog заменён LayoutInflater.from(requireContext()) на getLayoutInflater() для лучшего соответствия жизненному циклу Fragment.
2026-01-17 22:51:58 +03:00

132 lines
5.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
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">
<!-- TOP APP BAR -->
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:title="@string/app_name"/>
</com.google.android.material.appbar.AppBarLayout>
<RelativeLayout
android:id="@+id/content_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<!-- Progress bar -->
<com.google.android.material.progressindicator.LinearProgressIndicator
android:id="@+id/progressBar"
android:layout_width="match_parent"
android:layout_height="4dp"
android:visibility="gone" />
<!-- BOTTOM ACTION BAR -->
<LinearLayout
android:id="@+id/bottomBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="?colorSurface"
android:orientation="vertical"
android:padding="12dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/user_link_hint">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/singleLinkInput"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/multiLinkBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="@string/list_button" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal">
<com.google.android.material.button.MaterialButton
android:id="@+id/addBtn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/add_button" />
<com.google.android.material.button.MaterialButton
android:id="@+id/showUsersBtn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="8dp"
android:text="@string/show_button" />
<com.google.android.material.button.MaterialButton
android:id="@+id/removeBtn"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:text="@string/remove_button" />
</LinearLayout>
</LinearLayout>
<!-- CONTENT -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/bottomBar"
android:layout_below="@id/progressBar"
android:orientation="vertical">
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeRefresh"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="16dp"
android:paddingEnd="16dp" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</LinearLayout>
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>