Back to project page HijriCalendar-master.
The source code is released under:
MIT License
If you think the Android project HijriCalendar-master listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.sahaab.hijri.caldroid; /*from www. j a v a2 s . c om*/ import java.util.List; import android.content.Context; import android.graphics.Color; import android.util.TypedValue; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; /** * 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; } // Set color to gray and text size to 12sp @Override public View getView(int position, View convertView, ViewGroup parent) { // To customize text size and color TextView textView = (TextView) super.getView(position, convertView, parent); // Set content String item = getItem(position); // Show smaller text if the size of the text is 4 or more in some // locale if (item.length() <= 3) { textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12); } else { textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 11); } textView.setTextColor(textColor); textView.setGravity(Gravity.CENTER); return textView; } }