<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"tools:context="cl.cutiko.diadelpicoapp.ui.LoginActivity_"><!-- This is an Activity example --><!-- Here im using the style to get the custom_pb but you could also simple use the background property and reference it --><ProgressBarstyle="@style/custom_pb"></ProgressBar></RelativeLayout>
/*Or just add this in your Activity*/loginPb.getIndeterminateDrawable().setColorFilter(getResources().getColor(R.color.cta_third),PorterDuff.Mode.SRC_IN);
<?xml version="1.0" encoding="utf-8"?><rotatexmlns:android="http://schemas.android.com/apk/res/android"android:pivotX="50%"android:pivotY="50%"android:fromDegrees="0"android:toDegrees="360"><shapeandroid:shape="ring"android:innerRadiusRatio="3"android:thicknessRatio="8"android:useLevel="false"><sizeandroid:width="100dp"android:height="100dp"/><gradientandroid:type="sweep"android:useLevel="false"android:startColor="@color/cta_main"android:endColor="@color/cta_third"android:angle="0"/></shape></rotate><!-- Im using colors here taken from the color.xml file, create your own there or just use a hex color in place -->
<resources><!-- Dont need to copy this entire file just copy this in your style --><!-- see how custom_pb is reference for the background --><stylename="custom_pb"><itemname="android:layout_width">100dp</item><itemname="android:layout_height">100dp</item><itemname="android:layout_gravity">center_horizontal</item><itemname="android:background">@drawable/custom_pb</item><itemname="android:indeterminate">true</item></style></resources>
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.