highlight the current months' days

This commit is contained in:
tibbi 2016-01-27 21:21:41 +01:00
parent 3891f287ce
commit 4fb6e46bda
4 changed files with 19 additions and 3 deletions

View File

@ -33,7 +33,7 @@ public class MainActivity extends AppCompatActivity {
int cur = 0;
int thisMonthDays = 1;
int nextMonth = 1;
int nextMonthsDay = 1;
for (int i = 0; i < 6; i++) {
final TableRow row = (TableRow) inflater.inflate(R.layout.table_row, tableHolder, false);
@ -44,8 +44,9 @@ public class MainActivity extends AppCompatActivity {
currDate = prevMonthStart + cur;
} else if (currDate <= currMonthDays) {
thisMonthDays++;
day.setTextColor(getResources().getColor(R.color.darkGrey));
} else {
currDate = nextMonth++;
currDate = nextMonthsDay++;
}
day.setText(String.valueOf(currDate));

View File

@ -6,10 +6,20 @@
android:layout_height="match_parent"
tools:context="calendar.simplemobiletools.com.MainActivity">
<TextView
android:id="@+id/table_month"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/activity_margin"
android:gravity="center_horizontal"
android:textColor="@color/darkGrey"
android:textSize="24sp"/>
<TableLayout
android:id="@+id/table_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/table_month"
android:gravity="center">
</TableLayout>

View File

@ -5,4 +5,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"/>
android:gravity="center"
android:textColor="@color/lightGrey"
android:textSize="18sp"/>

View File

@ -3,4 +3,7 @@
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="lightGrey">#ffdddddd</color>
<color name="darkGrey">#ff555555</color>
</resources>