Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.Button;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.TextView;

import com.antonyt.infiniteviewpager.InfinitePagerAdapter;
Expand All @@ -39,6 +40,7 @@

import hirondelle.date4j.DateTime;


/**
* Caldroid is a fragment that display calendar with dates in a month. Caldroid
* can be used as embedded fragment, or as dialog fragment. <br/>
Expand Down Expand Up @@ -116,8 +118,8 @@ public class CaldroidFragment extends DialogFragment {
/**
* Caldroid view components
*/
private Button leftArrowButton;
private Button rightArrowButton;
private ImageView leftArrowButton;
private ImageView rightArrowButton;
private TextView monthTitleTextView;
private GridView weekdayGridView;
private InfiniteViewPager dateViewPager;
Expand Down Expand Up @@ -296,11 +298,11 @@ public HashMap<DateTime, Integer> getTextColorForDateTimeMap() {
/**
* To let user customize the navigation buttons
*/
public Button getLeftArrowButton() {
public ImageView getLeftArrowButton() {
return leftArrowButton;
}

public Button getRightArrowButton() {
public ImageView getRightArrowButton() {
return rightArrowButton;
}

Expand Down Expand Up @@ -1193,9 +1195,8 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
.findViewById(R.id.calendar_month_year_textview);

// For the left arrow button
leftArrowButton = (Button) view.findViewById(R.id.calendar_left_arrow);
rightArrowButton = (Button) view
.findViewById(R.id.calendar_right_arrow);
leftArrowButton = (ImageView) view.findViewById(R.id.calendar_left_arrow);
rightArrowButton = (ImageView) view.findViewById( R.id.calendar_right_arrow );

// Navigate to previous month when user click
leftArrowButton.setOnClickListener(new OnClickListener() {
Expand Down
34 changes: 25 additions & 9 deletions caldroid/src/main/res/layout/calendar_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@
<RelativeLayout
android:id="@+id/calendar_title_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">

<Button
<ImageView
android:id="@+id/calendar_left_arrow"
android:layout_width="50dp"
android:layout_height="44dp"
style="?styleCaldroidLeftArrow" />
android:layout_height="25dp"
style="?styleCaldroidLeftArrow"
android:layout_alignParentLeft="true"
android:src="@drawable/calendar_prev_arrow"
android:scaleType="fitStart"/>

<TextView
android:id="@+id/calendar_month_year_textview"
Expand All @@ -25,20 +31,30 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textIsSelectable="true"
style="?styleCaldroidMonthName"/>
style="?styleCaldroidMonthName"
android:layout_alignParentRight="false"
android:layout_alignParentTop="false"
android:layout_alignParentLeft="false"
android:layout_alignParentBottom="false"
android:layout_centerInParent="true"
android:gravity="center"
android:textSize="18dp"/>

<Button
<ImageView
android:id="@+id/calendar_right_arrow"
android:layout_width="50dp"
android:layout_height="44dp"
style="?styleCaldroidRightArrow" />
android:layout_height="25dp"
style="?styleCaldroidRightArrow"
android:layout_alignParentRight="true"
android:src="@drawable/calendar_next_arrow"
android:scaleType="fitEnd"/>
</RelativeLayout>

<GridView
android:id="@+id/weekday_gridview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-10dp"
android:layout_marginTop="10dp"
android:numColumns="7"
android:stretchMode="columnWidth" >
</GridView>
Expand Down