自定义CalendarView(Hijri)

Had*_*igy 5 android calendar hijri calendarview

我的应用程序是关于Hijri(伊斯兰)日历,但默认的android CalendarView是格里高利!如何自定义Android日历视图?!

我需要这样的东西:

在此输入图像描述

Son*_*mar 4

您好,访问所有给定的链接,希望对您有帮助

1. https://github.com/inteist/android-better-time-picker

2. https://github.com/derekbrameyer/android-betterpickers

3. http://www.androiddevelopersolutions.com/2013/05/android-calendar-sync.html

4. http://www.androidviews.net/2013/04/extendedcalendarview/

5. http://abinashandroid.wordpress.com/2013/07/21/how-to-create-custom-calendar-in-android/

6. http://w2davids.wordpress.com/android-simple-calendar/

7. https://github.com/roomorama/Caldroid

8. https://github.com/flavienlaurent/datetimepicker

当您访问以下内容时:

https://github.com/derekbrameyer/android-betterpickers

有关该项目的有效实施,请参阅示例/文件夹。

实施适当的Handler callbacks

public class MyActivity extends Activity implements     DatePickerDialogFragment.DatePickerDialogHandler {

      @Override
      public void onCreate(Bundle savedInstanceState) {
        // ...
      }

      @Override
      public void onDialogDateSet(int year, int monthOfYear, int dayOfMonth) {
        // Do something with your date!
      }
    }
Run Code Online (Sandbox Code Playgroud)

使用 Builder 类之一创建PickerDialog具有主题的主题:

DatePickerBuilder dpb = new DatePickerBuilder()
        .setFragmentManager(getSupportFragmentManager())
        .setStyleResId(R.style.BetterPickersDialogFragment);
dpb.show();
Run Code Online (Sandbox Code Playgroud)

另外一个例子你可以访问

https://github.com/roomorama/Caldroid

并使用如下

要将 caldroid 片段嵌入到您的活动中,请使用以下代码:

    CaldroidFragment caldroidFragment = new CaldroidFragment();
Bundle args = new Bundle();
Calendar cal = Calendar.getInstance();
args.putInt(CaldroidFragment.MONTH, cal.get(Calendar.MONTH) + 1);
args.putInt(CaldroidFragment.YEAR, cal.get(Calendar.YEAR));
caldroidFragment.setArguments(args);

FragmentTransaction t = getSupportFragmentManager().beginTransaction();
t.replace(R.id.calendar1, caldroidFragment);
t.commit();
Run Code Online (Sandbox Code Playgroud)