напиши мне лоадер на андроид мега красивый и минималистичный
- User
напиши мне лоадер на андроид мега красивый и минималистичный
Assistant
Вот современный минималистичный лоадер для Android в виде XML-файла. Использует плавную анимацию и Material Design подход:
<!-- res/layout/loader_minimal.xml --> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#FFFFFF"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:orientation="vertical" android:gravity="center"> <!-- Анимированные точки --> <LinearLayout android:layout_width="wrap_content" android:layout_height="40dp" android:orientation="horizontal" android:gravity="center"> <View android:id="@+id/dot1" android:layout_width="8dp" android:layout_height="8dp" android:layout_margin="4dp" android:background="@drawable/circle_shape"/> <View android:id="@+id/dot2" android:layout_width="8dp" android:layout_height="8dp" android:layout_margin="4dp" android:background="@drawable/circle_shape"/> <View android:id="@+id/dot3" android:layout_width="8dp" android:layout_height="8dp" android:layout_margin="4dp" android:background="@drawable/circle_shape"/> </LinearLayout> <!-- Опциональный текст --> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="16dp" android:text="Загрузка..." android:textColor="#757575" android:textSize="14sp" android:fontFamily="sans-serif-light"/> </LinearLayout> </FrameLayout>Создайте файл анимации для точек (res/drawable/circle_shape.xml):
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <solid android:color="#6200EE"/> <size android:width="8dp" android:height="8dp"/> </shape>И анимацию (res/anim/dot_loading.xml):
<set xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:fromYDelta="0" android:toYDelta="-10%p" android:duration="400" android:repeatCount="infinite" android:repeatMode="reverse"/> </set>Использование в Activity:
// В методе onCreate val loader = layoutInflater.inflate(R.layout.loader_minimal, null) setContentView(loader) // Запуск анимации val dots = arrayOf( loader.findViewById<View>(R.id.dot1), loader.findViewById<View>(R.id.dot2), loader.findViewById<View>(R.id.dot3) ) dots.forEachIndexed { index, dot -> val anim = AnimationUtils.loadAnimation(this, R.anim.dot_loading) anim.startOffset = index * 100L dot.startAnimation(anim) }Особенности этого лоадера:
- Минималистичный дизайн с тремя анимированными точками
- Плавная анимация подъема точек
- Неоново-фиолетовый акцентный цвет (можно изменить на любой)
- Адаптивные размеры (использует dp)
- Чистый белый фон
- Опциональный текст подсказки
- Современные шрифты Android
Вы можете настроить:
- Цвета (замените #6200EE на нужный)
- Размеры точек
- Скорость анимации
- Цвет текста
- Добавить/удалить текст
- Поменять фон (удалите android:background="#FFFFFF" для прозрачного)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.