Pie chart test
This commit is contained in:
@@ -24,8 +24,34 @@
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/margin_normal"
|
||||
android:layout_marginHorizontal="@dimen/margin_normal"
|
||||
android:layout_marginTop="@dimen/margin_normal"
|
||||
app:cardBackgroundColor="?attr/colorSurfaceContainerLow"
|
||||
app:cardCornerRadius="21dp">
|
||||
|
||||
<org.koitharu.kotatsu.core.ui.widgets.PieChart
|
||||
android:id="@+id/chart"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginVertical="16dp"
|
||||
android:layout_marginHorizontal="8dp"
|
||||
app:pieChartCircleSectionSpace="6"
|
||||
app:pieChartCircleStrokeWidth="18dp"
|
||||
app:pieChartColors="@array/chart_colors"
|
||||
app:pieChartTextAmount="Всего"
|
||||
app:pieChartTextAmountColor="?attr/colorControlNormal"
|
||||
app:pieChartTextDescriptionColor="?android:attr/textColorHint"
|
||||
app:pieChartTextDescriptionSize="14sp"
|
||||
app:pieChartTextNumberColor="?attr/colorControlNormal"
|
||||
app:pieChartTextNumberSize="16sp" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/margin_normal"
|
||||
android:layout_marginTop="@dimen/margin_normal"
|
||||
app:cardBackgroundColor="?attr/colorSurfaceContainerLow"
|
||||
app:cardCornerRadius="21dp">
|
||||
|
||||
|
||||
@@ -128,4 +128,29 @@
|
||||
<attr name="cornerSize" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="PieChart">
|
||||
<attr name="pieChartColors" format="reference"/>
|
||||
|
||||
<attr name="pieChartMarginTextFirst" format="dimension"/>
|
||||
<attr name="pieChartMarginTextSecond" format="dimension"/>
|
||||
<attr name="pieChartMarginTextThird" format="dimension"/>
|
||||
<attr name="pieChartMarginSmallCircle" format="dimension"/>
|
||||
|
||||
<attr name="pieChartCircleStrokeWidth" format="dimension"/>
|
||||
<attr name="pieChartCirclePadding" format="dimension"/>
|
||||
<attr name="pieChartCirclePaintRoundSize" format="boolean"/>
|
||||
<attr name="pieChartCircleSectionSpace" format="float"/>
|
||||
|
||||
<attr name="pieChartTextCircleRadius" format="dimension"/>
|
||||
<attr name="pieChartTextAmountSize" format="dimension"/>
|
||||
<attr name="pieChartTextNumberSize" format="dimension"/>
|
||||
<attr name="pieChartTextDescriptionSize" format="dimension"/>
|
||||
|
||||
<attr name="pieChartTextAmountColor" format="color"/>
|
||||
<attr name="pieChartTextNumberColor" format="color"/>
|
||||
<attr name="pieChartTextDescriptionColor" format="color"/>
|
||||
|
||||
<attr name="pieChartTextAmount" format="string"/>
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -55,4 +55,11 @@
|
||||
<item>HTTP</item>
|
||||
<item>SOCKS</item>
|
||||
</string-array>
|
||||
<string-array name="chart_colors" translatable="false">
|
||||
<item>#E480F4</item>
|
||||
<item>#6CC3F3</item>
|
||||
<item>#7167ED</item>
|
||||
<item>#D9455F</item>
|
||||
<item>#6054EA</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user