diff --git a/app/src/main/java/calendar/simplemobiletools/com/MainActivity.java b/app/src/main/java/calendar/simplemobiletools/com/MainActivity.java index 224af16ed..b8e2da269 100644 --- a/app/src/main/java/calendar/simplemobiletools/com/MainActivity.java +++ b/app/src/main/java/calendar/simplemobiletools/com/MainActivity.java @@ -15,18 +15,24 @@ import java.text.DateFormatSymbols; import butterknife.Bind; import butterknife.BindColor; +import butterknife.BindDimen; import butterknife.ButterKnife; import butterknife.OnClick; public class MainActivity extends AppCompatActivity { + private static final String PATTERN = "ddMMYYYY"; + @Bind(R.id.left_arrow) ImageView leftArrow; @Bind(R.id.right_arrow) ImageView rightArrow; @Bind(R.id.table_month) TextView monthTV; @Bind(R.id.table_holder) TableLayout tableHolder; @BindColor(R.color.darkGrey) int darkGrey; @BindColor(R.color.lightGrey) int lightGrey; + @BindDimen(R.dimen.day_text_size) float dayTextSize; + @BindDimen(R.dimen.today_text_size) float todayTextSize; private DateTime targetDate; + private String today; @Override protected void onCreate(Bundle savedInstanceState) { @@ -37,6 +43,7 @@ public class MainActivity extends AppCompatActivity { leftArrow.getDrawable().mutate().setColorFilter(darkGrey, PorterDuff.Mode.SRC_ATOP); rightArrow.getDrawable().mutate().setColorFilter(darkGrey, PorterDuff.Mode.SRC_ATOP); targetDate = new DateTime(); + today = new DateTime().toString(PATTERN); createDays(); fillCalendar(); @@ -68,12 +75,17 @@ public class MainActivity extends AppCompatActivity { final TableRow row = (TableRow) tableHolder.getChildAt(i); for (int j = 0; j < 7; j++) { final TextView day = (TextView) row.getChildAt(j); + day.setTextSize(dayTextSize); int currDate = thisMonthDays; if (cur < firstDayIndex) { currDate = prevMonthStart + cur; day.setTextColor(lightGrey); } else if (currDate <= currMonthDays) { + if (targetDate.withDayOfMonth(thisMonthDays).toString(PATTERN).equals(today)) { + day.setTextSize(todayTextSize); + } + thisMonthDays++; day.setTextColor(darkGrey); } else { diff --git a/app/src/main/res/layout/table_day.xml b/app/src/main/res/layout/table_day.xml index ec807e399..87f40e2c0 100644 --- a/app/src/main/res/layout/table_day.xml +++ b/app/src/main/res/layout/table_day.xml @@ -7,4 +7,4 @@ android:layout_weight="1" android:gravity="center" android:textColor="@color/lightGrey" - android:textSize="18sp"/> + android:textSize="@dimen/day_text_size"/> diff --git a/app/src/main/res/layout/table_row.xml b/app/src/main/res/layout/table_row.xml index efae06386..1db9f79bf 100644 --- a/app/src/main/res/layout/table_row.xml +++ b/app/src/main/res/layout/table_row.xml @@ -5,6 +5,4 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" - android:orientation="horizontal"> - - + android:orientation="horizontal"/> diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index e641ba457..ec0f81974 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -1,3 +1,6 @@ 16dp + + 10sp + 20sp