mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Minor style changes
This commit is contained in:
@@ -123,7 +123,7 @@ public class HabitHistoryView extends ScrollableDataView
|
|||||||
columnHeight = 8 * baseSize;
|
columnHeight = 8 * baseSize;
|
||||||
nColumns = width / baseSize;
|
nColumns = width / baseSize;
|
||||||
|
|
||||||
squareSpacing = baseSize / 10;
|
squareSpacing = (int) Math.floor(baseSize / 15.0);
|
||||||
pSquareFg.setTextSize(baseSize * 0.5f);
|
pSquareFg.setTextSize(baseSize * 0.5f);
|
||||||
pTextHeader.setTextSize(baseSize * 0.5f);
|
pTextHeader.setTextSize(baseSize * 0.5f);
|
||||||
squareTextOffset = pSquareFg.getFontSpacing() * 0.4f;
|
squareTextOffset = pSquareFg.getFontSpacing() * 0.4f;
|
||||||
@@ -138,9 +138,7 @@ public class HabitHistoryView extends ScrollableDataView
|
|||||||
this.primaryColor = habit.color;
|
this.primaryColor = habit.color;
|
||||||
|
|
||||||
if(isBackgroundTransparent)
|
if(isBackgroundTransparent)
|
||||||
{
|
|
||||||
primaryColor = ColorHelper.setMinValue(primaryColor, 0.75f);
|
primaryColor = ColorHelper.setMinValue(primaryColor, 0.75f);
|
||||||
}
|
|
||||||
|
|
||||||
int red = Color.red(primaryColor);
|
int red = Color.red(primaryColor);
|
||||||
int green = Color.green(primaryColor);
|
int green = Color.green(primaryColor);
|
||||||
@@ -149,7 +147,7 @@ public class HabitHistoryView extends ScrollableDataView
|
|||||||
if(isBackgroundTransparent)
|
if(isBackgroundTransparent)
|
||||||
{
|
{
|
||||||
colors = new int[3];
|
colors = new int[3];
|
||||||
colors[0] = Color.argb(64, 0, 0, 0);
|
colors[0] = Color.argb(16, 255, 255, 255);
|
||||||
colors[1] = Color.argb(128, red, green, blue);
|
colors[1] = Color.argb(128, red, green, blue);
|
||||||
colors[2] = primaryColor;
|
colors[2] = primaryColor;
|
||||||
textColor = Color.rgb(255, 255, 255);
|
textColor = Color.rgb(255, 255, 255);
|
||||||
@@ -160,7 +158,7 @@ public class HabitHistoryView extends ScrollableDataView
|
|||||||
colors[0] = Color.argb(25, 0, 0, 0);
|
colors[0] = Color.argb(25, 0, 0, 0);
|
||||||
colors[1] = Color.argb(127, red, green, blue);
|
colors[1] = Color.argb(127, red, green, blue);
|
||||||
colors[2] = primaryColor;
|
colors[2] = primaryColor;
|
||||||
textColor = Color.argb(128, 0, 0, 0);
|
textColor = Color.argb(64, 0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -94,21 +94,18 @@ public class HabitScoreView extends ScrollableDataView
|
|||||||
if(habit != null)
|
if(habit != null)
|
||||||
this.primaryColor = habit.color;
|
this.primaryColor = habit.color;
|
||||||
|
|
||||||
if(isBackgroundTransparent)
|
if (isBackgroundTransparent)
|
||||||
{
|
{
|
||||||
primaryColor = ColorHelper.setSaturation(primaryColor, 0.75f);
|
primaryColor = ColorHelper.setSaturation(primaryColor, 0.75f);
|
||||||
primaryColor = ColorHelper.setValue(primaryColor, 1.0f);
|
primaryColor = ColorHelper.setValue(primaryColor, 1.0f);
|
||||||
}
|
|
||||||
|
|
||||||
if(isBackgroundTransparent)
|
|
||||||
{
|
|
||||||
textColor = Color.argb(192, 255, 255, 255);
|
textColor = Color.argb(192, 255, 255, 255);
|
||||||
dimmedTextColor = Color.argb(128, 255, 255, 255);
|
dimmedTextColor = Color.argb(128, 255, 255, 255);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
textColor = Color.argb(128, 0, 0, 0);
|
textColor = Color.argb(64, 0, 0, 0);
|
||||||
dimmedTextColor = Color.argb(32, 0, 0, 0);
|
dimmedTextColor = Color.argb(16, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
colors = new int[4];
|
colors = new int[4];
|
||||||
@@ -122,12 +119,12 @@ public class HabitScoreView extends ScrollableDataView
|
|||||||
protected void createPaints()
|
protected void createPaints()
|
||||||
{
|
{
|
||||||
pText = new Paint();
|
pText = new Paint();
|
||||||
pText.setTextAlign(Paint.Align.LEFT);
|
|
||||||
pText.setAntiAlias(true);
|
pText.setAntiAlias(true);
|
||||||
|
|
||||||
pGraph = new Paint();
|
pGraph = new Paint();
|
||||||
pGraph.setTextAlign(Paint.Align.CENTER);
|
pGraph.setTextAlign(Paint.Align.CENTER);
|
||||||
pGraph.setAntiAlias(true);
|
pGraph.setAntiAlias(true);
|
||||||
|
|
||||||
pGrid = new Paint();
|
pGrid = new Paint();
|
||||||
pGrid.setAntiAlias(true);
|
pGrid.setAntiAlias(true);
|
||||||
}
|
}
|
||||||
@@ -204,6 +201,7 @@ public class HabitScoreView extends ScrollableDataView
|
|||||||
|
|
||||||
String previousMonth = "";
|
String previousMonth = "";
|
||||||
|
|
||||||
|
pText.setTextAlign(Paint.Align.CENTER);
|
||||||
pText.setColor(textColor);
|
pText.setColor(textColor);
|
||||||
pGraph.setColor(primaryColor);
|
pGraph.setColor(primaryColor);
|
||||||
prevRect.setEmpty();
|
prevRect.setEmpty();
|
||||||
@@ -240,6 +238,7 @@ public class HabitScoreView extends ScrollableDataView
|
|||||||
|
|
||||||
rect.set(0, 0, columnWidth, columnHeight);
|
rect.set(0, 0, columnWidth, columnHeight);
|
||||||
rect.offset(k * columnWidth, 0);
|
rect.offset(k * columnWidth, 0);
|
||||||
|
|
||||||
if (!month.equals(previousMonth))
|
if (!month.equals(previousMonth))
|
||||||
canvas.drawText(month, rect.centerX(), rect.bottom + lineHeight * 1.2f, pText);
|
canvas.drawText(month, rect.centerX(), rect.bottom + lineHeight * 1.2f, pText);
|
||||||
else
|
else
|
||||||
@@ -255,7 +254,10 @@ public class HabitScoreView extends ScrollableDataView
|
|||||||
int nRows = 5;
|
int nRows = 5;
|
||||||
float rowHeight = rGrid.height() / nRows;
|
float rowHeight = rGrid.height() / nRows;
|
||||||
|
|
||||||
|
pText.setTextAlign(Paint.Align.LEFT);
|
||||||
|
pText.setColor(textColor);
|
||||||
pGrid.setColor(dimmedTextColor);
|
pGrid.setColor(dimmedTextColor);
|
||||||
|
|
||||||
for (int i = 0; i < nRows; i++)
|
for (int i = 0; i < nRows; i++)
|
||||||
{
|
{
|
||||||
canvas.drawText(String.format("%d%%", (100 - i * 100 / nRows)), rGrid.left + 0.5f * em,
|
canvas.drawText(String.format("%d%%", (100 - i * 100 / nRows)), rGrid.left + 0.5f * em,
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ public class HabitStreakView extends ScrollableDataView
|
|||||||
colors[2] = Color.argb(192, red, green, blue);
|
colors[2] = Color.argb(192, red, green, blue);
|
||||||
colors[1] = Color.argb(96, red, green, blue);
|
colors[1] = Color.argb(96, red, green, blue);
|
||||||
colors[0] = Color.argb(32, 0, 0, 0);
|
colors[0] = Color.argb(32, 0, 0, 0);
|
||||||
textColor = Color.argb(128, 0, 0, 0);
|
textColor = Color.argb(64, 0, 0, 0);
|
||||||
pBarText = pBar;
|
pBarText = pBar;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,5 +3,5 @@
|
|||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
|
|
||||||
<solid android:color="#3f000000" />
|
<solid android:color="#3f000000" />
|
||||||
<corners android:radius="10dp" />
|
<corners android:radius="4dp" />
|
||||||
</shape>
|
</shape>
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
<org.isoron.uhabits.views.HabitHistoryView
|
<org.isoron.uhabits.views.HabitHistoryView
|
||||||
android:id="@+id/historyView"
|
android:id="@+id/historyView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="180dp"/>
|
android:layout_height="160dp"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user