Skip to content

Instantly share code, notes, and snippets.

@sunmeat
Forked from evik246/activity_main.xml
Created April 22, 2022 16:39
Show Gist options
  • Save sunmeat/2938d5618d98db12037ec0e72369bfd0 to your computer and use it in GitHub Desktop.
Save sunmeat/2938d5618d98db12037ec0e72369bfd0 to your computer and use it in GitHub Desktop.
Кнопки на черном фоне с цветами радуги
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:background="@color/black">
<Button
android:id="@+id/btn_green"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textAllCaps="true"
android:textColor="@color/black"
android:backgroundTint="@color/green"
android:text="Green"
/>
<Button
android:id="@+id/btn_yellow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/btn_green"
android:layout_alignLeft="@id/btn_green"
android:layout_marginBottom="-11dp"
android:backgroundTint="@color/yellow"
android:text="Yellow"
android:textAllCaps="true"
android:textColor="@color/black"
/>
<Button
android:id="@+id/btn_orange"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/btn_yellow"
android:layout_alignLeft="@id/btn_green"
android:layout_marginBottom="-11dp"
android:backgroundTint="@color/orange"
android:text="Orange"
android:textAllCaps="true"
android:textColor="@color/black"
/>
<Button
android:id="@+id/btn_red"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/btn_orange"
android:layout_alignLeft="@id/btn_green"
android:layout_marginBottom="-11dp"
android:backgroundTint="@color/red"
android:text="Red"
android:textAllCaps="true"
android:textColor="@color/black"
/>
<Button
android:id="@+id/btn_blue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/btn_green"
android:layout_alignLeft="@id/btn_green"
android:layout_marginTop="-11dp"
android:backgroundTint="@color/blue"
android:text="Blue"
android:textAllCaps="true"
android:textColor="@color/white"
/>
<Button
android:id="@+id/btn_indigo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/btn_blue"
android:layout_alignLeft="@id/btn_green"
android:layout_marginTop="-11dp"
android:backgroundTint="@color/indigo"
android:text="Indigo"
android:textAllCaps="true"
android:textColor="@color/white"
/>
<Button
android:id="@+id/btn_violet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/btn_indigo"
android:layout_alignLeft="@id/btn_green"
android:layout_marginTop="-11dp"
android:backgroundTint="@color/violet"
android:text="Violet"
android:textAllCaps="true"
android:textColor="@color/black"
/>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<!--Rainbow colors-->
<color name="red">#FF1E1E</color>
<color name="orange">#FF871E</color>
<color name="yellow">#FFE91E</color>
<color name="green">#25FF1E</color>
<color name="blue">#0942D3</color>
<color name="indigo">#5B02AA</color>
<color name="violet">#E06FFF</color>
</resources>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment