Android Open Source - Caldroid Weekday Array Adapter






From Project

Back to project page Caldroid.

License

The source code is released under:

MIT License

If you think the Android project Caldroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.roomorama.caldroid;
/*from   ww w.  j a v  a 2  s .  co m*/
import android.content.Context;
import android.graphics.Color;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.caldroid.R;

import java.util.List;

/**
 * Customize the weekday gridview
 */
public class WeekdayArrayAdapter extends ArrayAdapter<String> {
    public static int textColor = Color.LTGRAY;

    public WeekdayArrayAdapter(Context context, int textViewResourceId,
                               List<String> objects) {
        super(context, textViewResourceId, objects);
    }

    // To prevent cell highlighted when clicked
    @Override
    public boolean areAllItemsEnabled() {
        return false;
    }

    @Override
    public boolean isEnabled(int position) {
        return false;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        // To customize text size and color
        LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        TextView textView = (TextView) inflater.inflate(R.layout.weekday_textview, null);

        // Set content
        String item = getItem(position);
        textView.setText(item);

        textView.setTextColor(textColor);
        textView.setGravity(Gravity.CENTER);
        return textView;
    }

}




Java Source Code List

com.antonyt.infiniteviewpager.InfinitePagerAdapter.java
com.antonyt.infiniteviewpager.InfiniteViewPager.java
com.caldroidsample.CaldroidSampleActivity.java
com.caldroidsample.CaldroidSampleCustomAdapter.java
com.caldroidsample.CaldroidSampleCustomFragment.java
com.roomorama.caldroid.CaldroidFragment.java
com.roomorama.caldroid.CaldroidGridAdapter.java
com.roomorama.caldroid.CaldroidListener.java
com.roomorama.caldroid.CalendarHelper.java
com.roomorama.caldroid.DateGridFragment.java
com.roomorama.caldroid.MonthPagerAdapter.java
com.roomorama.caldroid.SquareTextView.java
com.roomorama.caldroid.WeekdayArrayAdapter.java