├── lint.xml
├── bin
├── Hijri.apk
├── classes.dex
├── resources.ap_
├── res
│ ├── drawable-hdpi
│ │ ├── back.png
│ │ ├── bg3.png
│ │ ├── bg4.png
│ │ ├── appbg.png
│ │ ├── background.png
│ │ └── ic_launcher.png
│ ├── drawable-ldpi
│ │ └── ic_launcher.png
│ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ └── drawable-xhdpi
│ │ └── ic_launcher.png
├── classes
│ ├── kankan
│ │ └── wheel
│ │ │ ├── R.class
│ │ │ └── R$drawable.class
│ └── com
│ │ └── mos7af
│ │ └── hijri
│ │ ├── R.class
│ │ ├── Hijri.class
│ │ ├── R$id.class
│ │ ├── R$xml.class
│ │ ├── Hijri$1.class
│ │ ├── Hijri$2.class
│ │ ├── NewMoon.class
│ │ ├── R$attr.class
│ │ ├── R$menu.class
│ │ ├── R$style.class
│ │ ├── APC_Math.class
│ │ ├── APC_Time.class
│ │ ├── MoonPhases.class
│ │ ├── R$drawable.class
│ │ ├── R$layout.class
│ │ ├── R$string.class
│ │ ├── BuildConfig.class
│ │ ├── CrescentMoon.class
│ │ ├── DateActivity.class
│ │ ├── HijriWidget.class
│ │ ├── MyDatePicker.class
│ │ ├── CustomTextView.class
│ │ ├── DateActivity$1.class
│ │ ├── DateActivity$2.class
│ │ ├── DateActivity$3.class
│ │ ├── GregorianWidget.class
│ │ ├── HijriCalendar.class
│ │ ├── EclipticPosition.class
│ │ ├── GregorianCalendar.class
│ │ ├── DateActivity$DateArrayAdapter.class
│ │ └── DateActivity$DateNumericAdapter.class
├── jarlist.cache
├── dexedLibs
│ ├── wheel-f8c6d376147e785857110d135d74fca7.jar
│ └── android-support-v4-69eba587f6d4f6be3914f4674715aaae.jar
├── R.txt
└── AndroidManifest.xml
├── ic_launcher-web.png
├── res
├── drawable-hdpi
│ ├── bg3.png
│ ├── bg4.png
│ ├── appbg.png
│ ├── back.png
│ ├── background.png
│ ├── ic_launcher.png
│ ├── bg.xml
│ ├── gradient_bg_hover.xml
│ ├── gradient_bg.xml
│ ├── screen_background.xml
│ └── footerbg.xml
├── drawable-ldpi
│ └── ic_launcher.png
├── drawable-mdpi
│ └── ic_launcher.png
├── drawable-xhdpi
│ └── ic_launcher.png
├── values
│ ├── strings.xml
│ └── styles.xml
├── menu
│ └── ly_hijri.xml
├── xml
│ └── watch_widget_provider.xml
├── values-v11
│ └── styles.xml
├── values-v14
│ └── styles.xml
├── drawable
│ └── layout_bg.xml
└── layout
│ ├── main.xml
│ ├── date_layout.xml
│ └── ly_hijri.xml
├── assets
└── fonts
│ └── hallfetica.ttf
├── libs
└── android-support-v4.jar
├── README.md
├── gen
├── com
│ └── mos7af
│ │ └── hijri
│ │ ├── BuildConfig.java
│ │ └── R.java
└── kankan
│ └── wheel
│ └── R.java
├── src
└── com
│ └── mos7af
│ └── hijri
│ ├── MoonPhases.java
│ ├── CustomTextView.java
│ ├── MyDatePicker.java
│ ├── GregorianWidget.java
│ ├── HijriWidget.java
│ ├── CrescentMoon.java
│ ├── NewMoon.java
│ ├── EclipticPosition.java
│ ├── APC_Time.java
│ ├── GregorianCalendar.java
│ ├── APC_Math.java
│ ├── DateActivity.java
│ ├── HijriCalendar.java
│ └── Hijri.java
├── .settings
└── org.eclipse.core.resources.prefs
├── .classpath
├── project.properties
├── proguard-project.txt
├── .project
└── AndroidManifest.xml
/lint.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/bin/Hijri.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/Hijri.apk
--------------------------------------------------------------------------------
/bin/classes.dex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes.dex
--------------------------------------------------------------------------------
/bin/resources.ap_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/resources.ap_
--------------------------------------------------------------------------------
/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/ic_launcher-web.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/bg3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/res/drawable-hdpi/bg3.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/bg4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/res/drawable-hdpi/bg4.png
--------------------------------------------------------------------------------
/assets/fonts/hallfetica.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/assets/fonts/hallfetica.ttf
--------------------------------------------------------------------------------
/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/res/drawable-hdpi/appbg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/res/drawable-hdpi/appbg.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/res/drawable-hdpi/back.png
--------------------------------------------------------------------------------
/bin/res/drawable-hdpi/back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/res/drawable-hdpi/back.png
--------------------------------------------------------------------------------
/bin/res/drawable-hdpi/bg3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/res/drawable-hdpi/bg3.png
--------------------------------------------------------------------------------
/bin/res/drawable-hdpi/bg4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/res/drawable-hdpi/bg4.png
--------------------------------------------------------------------------------
/bin/classes/kankan/wheel/R.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/kankan/wheel/R.class
--------------------------------------------------------------------------------
/bin/res/drawable-hdpi/appbg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/res/drawable-hdpi/appbg.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/res/drawable-hdpi/background.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-ldpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/res/drawable-ldpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/R.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/R.class
--------------------------------------------------------------------------------
/bin/res/drawable-hdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/res/drawable-hdpi/background.png
--------------------------------------------------------------------------------
/bin/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/drawable-ldpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/res/drawable-ldpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/Hijri.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/Hijri.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/R$id.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/R$id.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/R$xml.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/R$xml.class
--------------------------------------------------------------------------------
/bin/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/Hijri$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/Hijri$1.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/Hijri$2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/Hijri$2.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/NewMoon.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/NewMoon.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/R$attr.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/R$attr.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/R$menu.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/R$menu.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/R$style.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/R$style.class
--------------------------------------------------------------------------------
/bin/classes/kankan/wheel/R$drawable.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/kankan/wheel/R$drawable.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/APC_Math.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/APC_Math.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/APC_Time.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/APC_Time.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/MoonPhases.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/MoonPhases.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/R$drawable.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/R$drawable.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/R$layout.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/R$layout.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/R$string.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/R$string.class
--------------------------------------------------------------------------------
/bin/jarlist.cache:
--------------------------------------------------------------------------------
1 | # cache for current jar dependecy. DO NOT EDIT.
2 | # format is
3 | # Encoding is UTF-8
4 |
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/BuildConfig.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/BuildConfig.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/CrescentMoon.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/CrescentMoon.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/DateActivity.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/DateActivity.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/HijriWidget.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/HijriWidget.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/MyDatePicker.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/MyDatePicker.class
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Hijri-Calendar
2 | ==============
3 |
4 | Hijri Calendar - التقويم الهجري
5 |
6 | wheel library:
7 | https://code.google.com/p/android-wheel/
8 |
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/CustomTextView.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/CustomTextView.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/DateActivity$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/DateActivity$1.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/DateActivity$2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/DateActivity$2.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/DateActivity$3.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/DateActivity$3.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/GregorianWidget.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/GregorianWidget.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/HijriCalendar.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/HijriCalendar.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/EclipticPosition.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/EclipticPosition.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/GregorianCalendar.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/GregorianCalendar.class
--------------------------------------------------------------------------------
/bin/dexedLibs/wheel-f8c6d376147e785857110d135d74fca7.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/dexedLibs/wheel-f8c6d376147e785857110d135d74fca7.jar
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/DateActivity$DateArrayAdapter.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/DateActivity$DateArrayAdapter.class
--------------------------------------------------------------------------------
/bin/classes/com/mos7af/hijri/DateActivity$DateNumericAdapter.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/classes/com/mos7af/hijri/DateActivity$DateNumericAdapter.class
--------------------------------------------------------------------------------
/bin/dexedLibs/android-support-v4-69eba587f6d4f6be3914f4674715aaae.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abodehq/Hijri-Calendar/HEAD/bin/dexedLibs/android-support-v4-69eba587f6d4f6be3914f4674715aaae.jar
--------------------------------------------------------------------------------
/gen/com/mos7af/hijri/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /** Automatically generated file. DO NOT MODIFY */
2 | package com.mos7af.hijri;
3 |
4 | public final class BuildConfig {
5 | public final static boolean DEBUG = true;
6 | }
--------------------------------------------------------------------------------
/res/drawable-hdpi/bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | هجري
5 | Hello world!
6 | Settings
7 |
8 |
--------------------------------------------------------------------------------
/src/com/mos7af/hijri/MoonPhases.java:
--------------------------------------------------------------------------------
1 | package com.mos7af.hijri;
2 | /*
3 | * To change this template, choose Tools | Templates
4 | * and open the template in the editor.
5 | */
6 |
7 | public abstract class MoonPhases {
8 | public abstract double calculatePhase(double T);
9 | }
10 |
--------------------------------------------------------------------------------
/res/menu/ly_hijri.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | encoding//src/com/mos7af/hijri/DateActivity.java=UTF-8
3 | encoding//src/com/mos7af/hijri/GregorianCalendar.java=UTF-8
4 | encoding//src/com/mos7af/hijri/Hijri.java=UTF-8
5 | encoding//src/com/mos7af/hijri/HijriCalendar.java=UTF-8
6 |
--------------------------------------------------------------------------------
/res/xml/watch_widget_provider.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/gradient_bg_hover.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/gradient_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
--------------------------------------------------------------------------------
/gen/kankan/wheel/R.java:
--------------------------------------------------------------------------------
1 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
2 | *
3 | * This class was automatically generated by the
4 | * aapt tool from the resource data it found. It
5 | * should not be modified by hand.
6 | */
7 | package kankan.wheel;
8 |
9 | public final class R {
10 | public static final class drawable {
11 | public static final int wheel_val = 0x7f02000d;
12 | public static final int wheel_bg = 0x7f02000c;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/screen_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
8 |
--------------------------------------------------------------------------------
/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-17
15 | android.library.reference.1=../wheel
16 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/footerbg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
5 |
6 |
11 |
12 |
13 |
14 |
16 |
19 |
--------------------------------------------------------------------------------
/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
--------------------------------------------------------------------------------
/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/src/com/mos7af/hijri/CustomTextView.java:
--------------------------------------------------------------------------------
1 | package com.mos7af.hijri;
2 |
3 | import android.content.Context;
4 | import android.graphics.Typeface;
5 | import android.util.AttributeSet;
6 | import android.widget.TextView;
7 |
8 | public class CustomTextView extends TextView{
9 | public CustomTextView(Context context, AttributeSet attrs) {
10 | super(context, attrs);
11 | initTextFont(context);
12 | }
13 |
14 | public CustomTextView(Context context, AttributeSet attrs, int defStyle) {
15 | super(context, attrs, defStyle);
16 | initTextFont(context);
17 | }
18 |
19 | private void initTextFont(Context context) {
20 | String fontPath = "fonts/hallfetica.ttf";
21 | Typeface tf = Typeface.createFromAsset(context.getAssets(), fontPath);
22 | setTypeface(tf);
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hijri
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/res/drawable/layout_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
20 |
21 |
22 |
27 |
28 |
--------------------------------------------------------------------------------
/src/com/mos7af/hijri/MyDatePicker.java:
--------------------------------------------------------------------------------
1 | package com.mos7af.hijri;
2 |
3 | import java.lang.reflect.Field;
4 | import java.lang.reflect.Method;
5 |
6 | import android.content.Context;
7 | import android.text.TextUtils;
8 | import android.util.AttributeSet;
9 | import android.widget.DatePicker;
10 |
11 |
12 | class MyDatePicker extends DatePicker {
13 |
14 | public MyDatePicker(Context context, AttributeSet attrs) {
15 | super(context, attrs);
16 | Field[] fields = DatePicker.class.getDeclaredFields();
17 | try {
18 | for (Field field : fields) {
19 | field.setAccessible(true);
20 | if (TextUtils.equals(field.getName(), "mMonthPicker")) {
21 | Method m = field.getType().getDeclaredMethod("setRange", int.class, int.class, String[].class);
22 | m.setAccessible(true);
23 | String[] s = new String[] {"01","02","03","04","05","06","07","08","09","10","11","12"};
24 | m.invoke(field.get(this), 1, 12, s);
25 | break;
26 | }
27 | }
28 | }
29 | catch (Exception e) {
30 | System.out.println(e.getMessage());
31 | e.printStackTrace();
32 | }
33 | }
34 |
35 | }
--------------------------------------------------------------------------------
/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
24 |
25 |
36 |
37 |
--------------------------------------------------------------------------------
/src/com/mos7af/hijri/GregorianWidget.java:
--------------------------------------------------------------------------------
1 | package com.mos7af.hijri;
2 |
3 | import android.appwidget.AppWidgetProvider;
4 |
5 |
6 | import java.text.DateFormat;
7 | import java.text.SimpleDateFormat;
8 | import java.util.Calendar;
9 | import java.util.Date;
10 | import java.util.Locale;
11 | import android.appwidget.AppWidgetManager;
12 | import android.content.ComponentName;
13 | import android.content.Context;
14 | import android.graphics.Typeface;
15 | import android.util.Log;
16 | import android.widget.RemoteViews;
17 | import android.widget.TextView;
18 | public class GregorianWidget extends AppWidgetProvider {
19 | @Override
20 | public void onUpdate( Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds )
21 | {
22 | RemoteViews remoteViews;
23 | ComponentName watchWidget;
24 | DateFormat format = SimpleDateFormat.getTimeInstance( SimpleDateFormat.MEDIUM, Locale.getDefault() );
25 |
26 | remoteViews = new RemoteViews( context.getPackageName(), R.layout.main );
27 | watchWidget = new ComponentName( context, GregorianWidget.class );
28 | Calendar calendar = Calendar.getInstance();
29 | remoteViews.setTextViewText( R.id.widget_day, Integer.toString(calendar.get(Calendar.DAY_OF_MONTH)));
30 | GregorianCalendar gregorianCalendar = new GregorianCalendar();
31 |
32 | remoteViews.setTextViewText( R.id.widget_month, gregorianCalendar.getMonthName(calendar.get(Calendar.MONTH)));
33 | appWidgetManager.updateAppWidget( watchWidget, remoteViews );
34 | }
35 | }
36 |
37 |
--------------------------------------------------------------------------------
/src/com/mos7af/hijri/HijriWidget.java:
--------------------------------------------------------------------------------
1 | package com.mos7af.hijri;
2 |
3 | import android.appwidget.AppWidgetProvider;
4 |
5 |
6 | import java.text.DateFormat;
7 | import java.text.SimpleDateFormat;
8 | import java.util.Calendar;
9 | import java.util.Date;
10 | import java.util.Locale;
11 | import android.appwidget.AppWidgetManager;
12 | import android.content.ComponentName;
13 | import android.content.Context;
14 | import android.graphics.Typeface;
15 | import android.util.Log;
16 | import android.widget.RemoteViews;
17 | import android.widget.TextView;
18 | public class HijriWidget extends AppWidgetProvider {
19 | @Override
20 | public void onUpdate( Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds )
21 | {
22 | RemoteViews remoteViews;
23 | ComponentName watchWidget;
24 | DateFormat format = SimpleDateFormat.getTimeInstance( SimpleDateFormat.MEDIUM, Locale.getDefault() );
25 |
26 | remoteViews = new RemoteViews( context.getPackageName(), R.layout.main );
27 | watchWidget = new ComponentName( context, HijriWidget.class );
28 | Calendar calendar = Calendar.getInstance();
29 | HijriCalendar hijriCalendar =new HijriCalendar(calendar.get(Calendar.YEAR),calendar.get(Calendar.MONTH)+1,calendar.get(Calendar.DAY_OF_MONTH));
30 | String hijriDay=Integer.toString( hijriCalendar.getHijriDay());
31 | String hijriMonth= hijriCalendar.getHijriMonthName();
32 | remoteViews.setTextViewText( R.id.widget_day, hijriDay);
33 | remoteViews.setTextViewText( R.id.widget_month, hijriMonth);
34 | appWidgetManager.updateAppWidget( watchWidget, remoteViews );
35 | }
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/bin/R.txt:
--------------------------------------------------------------------------------
1 | int drawable appbg 0x7f020000
2 | int drawable back 0x7f020001
3 | int drawable background 0x7f020002
4 | int drawable bg 0x7f020003
5 | int drawable bg3 0x7f020004
6 | int drawable bg4 0x7f020005
7 | int drawable footerbg 0x7f020006
8 | int drawable gradient_bg 0x7f020007
9 | int drawable gradient_bg_hover 0x7f020008
10 | int drawable ic_launcher 0x7f020009
11 | int drawable layout_bg 0x7f02000a
12 | int drawable screen_background 0x7f02000b
13 | int drawable wheel_bg 0x7f02000c
14 | int drawable wheel_val 0x7f02000d
15 | int id LinearLayout01 0x7f08000a
16 | int id RelativeLayout01 0x7f080007
17 | int id TextView01 0x7f080015
18 | int id TextView02 0x7f080016
19 | int id btnHijri 0x7f080011
20 | int id btnMiladi 0x7f080013
21 | int id btnSubmit 0x7f080008
22 | int id btn_cancel 0x7f080009
23 | int id day 0x7f080004
24 | int id day_name 0x7f080001
25 | int id digitalClock1 0x7f080002
26 | int id footer 0x7f080000
27 | int id linearLayout1 0x7f080003
28 | int id menu_settings 0x7f080017
29 | int id month 0x7f080005
30 | int id text_hijri 0x7f080014
31 | int id text_mili 0x7f080012
32 | int id widget_day 0x7f08000b
33 | int id widget_mil_day 0x7f08000e
34 | int id widget_mil_month 0x7f08000f
35 | int id widget_mil_month_name 0x7f080010
36 | int id widget_month 0x7f08000c
37 | int id widget_month_name 0x7f08000d
38 | int id year 0x7f080006
39 | int layout date_layout 0x7f030000
40 | int layout ly_hijri 0x7f030001
41 | int layout main 0x7f030002
42 | int menu ly_hijri 0x7f070000
43 | int string app_name 0x7f050000
44 | int string hello_world 0x7f050001
45 | int string menu_settings 0x7f050002
46 | int style AppBaseTheme 0x7f060000
47 | int style AppTheme 0x7f060001
48 | int xml watch_widget_provider 0x7f040000
49 |
--------------------------------------------------------------------------------
/src/com/mos7af/hijri/CrescentMoon.java:
--------------------------------------------------------------------------------
1 | package com.mos7af.hijri;
2 |
3 | /*
4 | * To change this template, choose Tools | Templates
5 | * and open the template in the editor.
6 | */
7 | /**
8 | *
9 | * @author http://www.cepmuvakkit.com
10 | */
11 | public class CrescentMoon extends MoonPhases {
12 |
13 | EclipticPosition eclipPos;
14 | //------------------------------------------------------------------------------
15 | //
16 | // PhasesFunc: Goal function for search of phase events [-pi, pi]
17 | //
18 | // Input:
19 | //
20 | // T Ephemeris Time (Julian centuries since J2000)
21 | //
22 | // : Difference between the longitude of the Moon from the Sun
23 | // and the nominal value for a given phase (New Moon 0, First
24 | // Quarter pi/2, etc.) (in [rad])
25 | //
26 | // Global:
27 | //
28 | // Phase Flag for desired lunar phase
29 | //
30 | //------------------------------------------------------------------------------
31 | public double calculatePhase(double T) {
32 | //
33 | // Constants
34 | //
35 | double tau_Sun = 8.32 / (1440.0 * 36525.0); // 8.32 min [cy]
36 | double beta, l_Moon, l_Sun;
37 | double[] moonLongLat;
38 | double angle = 8;// 8 degree; crescent visibility criteria
39 | //
40 | // Variables
41 | //
42 | l_Sun = EclipticPosition.getMiniSunLongitude(T - tau_Sun);
43 | moonLongLat = EclipticPosition.getMiniMoon(T);
44 | l_Moon = moonLongLat[0];
45 | beta = moonLongLat[1];
46 |
47 |
48 | double LongDiff = l_Moon - l_Sun;
49 | double elongation = Math.sqrt(LongDiff * LongDiff + beta * beta);
50 |
51 | return (Math.PI * angle / 180.0 - elongation);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
10 |
15 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/bin/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
10 |
15 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/src/com/mos7af/hijri/NewMoon.java:
--------------------------------------------------------------------------------
1 | package com.mos7af.hijri;
2 |
3 | /*
4 | * To change this template, choose Tools | Templates
5 | * and open the template in the editor.
6 | */
7 | /**
8 | *
9 | * @author http://www.cepmuvakkit.com
10 | */
11 | public class NewMoon extends MoonPhases {
12 |
13 | EclipticPosition eclipPos=new EclipticPosition();
14 |
15 | //------------------------------------------------------------------------------
16 | //
17 | // PhasesFunc: Goal function for search of phase events [-pi, pi]
18 | //
19 | // Input:
20 | //
21 | // T Ephemeris Time (Julian centuries since J2000)
22 | //
23 | // : Difference between the longitude of the Moon from the Sun
24 | // and the nominal value for a given phase (New Moon 0, First
25 | // Quarter pi/2, etc.) (in [rad])
26 | //
27 | // Global:
28 | //
29 | // Phase Flag for desired lunar phase
30 | //
31 | //------------------------------------------------------------------------------
32 | public double calculatePhase(double T)
33 | {
34 | //
35 | // Constants
36 | //
37 | double tau_Sun = 8.32 / (1440.0*36525.0); // 8.32 min [cy]
38 | double beta,l_Moon,l_Sun;
39 | double [] moonLongLat;
40 | double pi2=2*Math.PI;
41 | //
42 | // Variables
43 | //
44 | l_Sun=EclipticPosition.getMiniSunLongitude (T-tau_Sun);
45 | moonLongLat=EclipticPosition.getMiniMoon (T);//4.348761468846075
46 | l_Moon=moonLongLat[0];//-0.039226153787816305
47 | beta=moonLongLat[1];
48 |
49 |
50 | double LongDiff = l_Moon - l_Sun;
51 |
52 |
53 | //if (LongDiff<0) LongDiff=LongDiff+pi2;
54 | // return ((LongDiff+Math.PI)%pi2)-Math.PI;
55 | return Modulo ( LongDiff+Math.PI,pi2)-Math.PI;
56 | }
57 | //------------------------------------------------------------------------------
58 | //
59 | // Modulo: calculates x mod y
60 | //
61 | //------------------------------------------------------------------------------
62 | private double Modulo (double x, double y)
63 | {
64 | return y*Frac(x/y);
65 | }
66 | //------------------------------------------------------------------------------
67 | //
68 | // Frac: Gives the fractional part of a number
69 | //
70 | //------------------------------------------------------------------------------
71 |
72 | private double Frac (double x)
73 | {
74 | return x-Math.floor(x);
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/src/com/mos7af/hijri/EclipticPosition.java:
--------------------------------------------------------------------------------
1 | package com.mos7af.hijri;
2 | /**
3 | *
4 | * @author http://www.cepmuvakkit.com
5 | */
6 | public class EclipticPosition {
7 |
8 | //------------------------------------------------------------------------------
9 | //
10 | // MiniSun: Computes the Sun's RA and declination using a low precision
11 | // analytical series
12 | //
13 | // Input:
14 | //
15 | // T Time in Julian centuries since J2000
16 | //
17 | // Output:
18 | //
19 | // L ecliptic longitude of the Sun in [rad]
20 | //------------------------------------------------------------------------------
21 | static double getMiniSunLongitude(double T) {
22 | double pi2 = Math.PI * 2;
23 | double M;
24 |
25 | // Mean anomaly and ecliptic longitude
26 | M = pi2 * APC_Math.Frac(0.993133 + 99.997361 * T);
27 | return pi2 * APC_Math.Frac(0.7859453 + M / pi2 + (6893.0 * Math.sin(M) + 72.0 * Math.sin(2.0 * M) + 6191.2 * T) / 1296.0e3);
28 |
29 | }
30 |
31 | //------------------------------------------------------------------------------
32 | //
33 | // MiniMoon: Computes the Moon's REcliptic longitude and latitude using a low precision
34 | // analytical series
35 | //
36 | // Input:
37 | //
38 | // T Time in Julian centuries since J2000
39 | //
40 | // Output:
41 | //
42 | // l_Moon Ecliptic longitude of the Moon in [rad]
43 | // b_Moon Ecliptic latitude of the Moon in [rad]
44 | //
45 | //------------------------------------------------------------------------------
46 | static double[] getMiniMoon(double T) {
47 |
48 | double[] moonLongLat = new double[2];
49 | double pi2 = 2 * Math.PI;
50 | double Arcs = 3600.0 * 180.0 / Math.PI;
51 | // Variables
52 | double L_0, l, ls, F, D, dL, S, h, N;
53 | // Mean elements of lunar orbit
54 |
55 | L_0 = APC_Math.Frac(0.606433 + 1336.855225 * T); // mean longitude [rev]
56 |
57 | l = pi2 * APC_Math.Frac(0.374897 + 1325.552410 * T); // Moon's mean anomaly
58 | ls = pi2 * APC_Math.Frac(0.993133 + 99.997361 * T); // Sun's mean anomaly
59 | D = pi2 * APC_Math.Frac(0.827361 + 1236.853086 * T); // Diff. long. Moon-Sun
60 | F = pi2 * APC_Math.Frac(0.259086 + 1342.227825 * T); // Dist. from ascending node
61 |
62 |
63 | // Perturbations in longitude and latitude
64 | dL = +22640 * Math.sin(l) - 4586 * Math.sin(l - 2 * D) + 2370 * Math.sin(2 * D) + 769 * Math.sin(2 * l) - 668 * Math.sin(ls) - 412 * Math.sin(2 * F) - 212 * Math.sin(2 * l - 2 * D) - 206 * Math.sin(l + ls - 2 * D) + 192 * Math.sin(l + 2 * D) - 165 * Math.sin(ls - 2 * D) - 125 * Math.sin(D) - 110 * Math.sin(l + ls) + 148 * Math.sin(l - ls) - 55 * Math.sin(2 * F - 2 * D);
65 | S = F + (dL + 412 * Math.sin(2 * F) + 541 * Math.sin(ls)) / Arcs;
66 | h = F - 2 * D;
67 | N = -526 * Math.sin(h) + 44 * Math.sin(l + h) - 31 * Math.sin(-l + h) - 23 * Math.sin(ls + h) + 11 * Math.sin(-ls + h) - 25 * Math.sin(-2 * l + F) + 21 * Math.sin(-l + F);
68 |
69 |
70 | // Ecliptic longitude and latitude
71 | moonLongLat[0] = pi2 * APC_Math.Frac(L_0 + dL / 1296.0e3);
72 | moonLongLat[1] = (18520.0 * Math.sin(S) + N) / Arcs;
73 |
74 | return moonLongLat;
75 |
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/res/layout/date_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
28 |
29 |
40 |
41 |
42 |
53 |
54 |
58 |
59 |
63 |
64 |
68 |
69 |
70 |
79 |
80 |
86 |
87 |
93 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/src/com/mos7af/hijri/APC_Time.java:
--------------------------------------------------------------------------------
1 | package com.mos7af.hijri;
2 |
3 | /*
4 | * To change this template, choose Tools | Templates
5 | * and open the template in the editor.
6 | */
7 | import java.util.Calendar;
8 |
9 | /**
10 | *
11 | * @author http://www.cepmuvakkit.com
12 | */
13 | public class APC_Time {
14 | //------------------------------------------------------------------------------
15 | //
16 | // Mjd: Modified Julian Date from calendar date and time
17 | //
18 | // Input:
19 | //
20 | // Year Calendar date components
21 | // Month
22 | // Day
23 | // Hour Time components (optional)
24 | // Min
25 | // Sec
26 | //
27 | // : Modified Julian Date
28 | // *BU*
29 | //------------------------------------------------------------------------------
30 | public static double Mjd(int Year, int Month, int Day,
31 | int Hour, int Min, double Sec) {
32 | //
33 | // Variables
34 | //
35 | long MjdMidnight;
36 | double FracOfDay;
37 | int b;
38 |
39 |
40 | if (Month <= 2) {
41 | Month += 12;
42 | --Year;
43 | }
44 |
45 | if ((10000L * Year + 100L * Month + Day) <= 15821004L) {
46 | b = -2 + ((Year + 4716) / 4) - 1179; // Julian calendar
47 | } else {
48 | b = (Year / 400) - (Year / 100) + (Year / 4); // Gregorian calendar
49 | }
50 | MjdMidnight = 365L * Year - 679004L + b + (int) (30.6001 * (Month + 1)) + Day;
51 | FracOfDay = APC_Math.Ddd(Hour, Min, Sec) / 24.0;
52 |
53 | return MjdMidnight + FracOfDay;
54 | }
55 |
56 | //------------------------------------------------------------------------------
57 | //
58 | // CalDat: Calendar date and time from Modified Julian Date
59 | //
60 | // Input:
61 | //
62 | // Mjd Modified Julian Date
63 | //
64 | // Output:
65 | //
66 | // Year Calendar date components
67 | // Month
68 | // Day
69 | // Hour Decimal hours
70 | //
71 | //------------------------------------------------------------------------------
72 | public static Calendar CalDat(double Mjd) {
73 | //
74 | // Variables
75 | //*BU*
76 | long a, b, c, d, e, f;
77 | double FracOfDay, hour;
78 | int Year, Month, Day, Hour, Minute;
79 | Calendar cal = Calendar.getInstance();
80 |
81 | //GregorianCalendar.set (Year,Month,Day,Hour);
82 | //Date result=new Date (Year,Month,Day,Hour);
83 | // Convert Julian day number to calendar date
84 | a = (long) (Mjd + 2400001.0);
85 |
86 | if (a < 2299161) { // Julian calendar
87 | b = 0;
88 | c = a + 1524;
89 | } else { // Gregorian calendar
90 | b = (long) ((a - 1867216.25) / 36524.25);
91 | c = a + b - (b / 4) + 1525;
92 | }
93 |
94 | d = (long) ((c - 122.1) / 365.25);
95 | e = 365 * d + d / 4;
96 | f = (long) ((c - e) / 30.6001);
97 |
98 | Day = (int) (c - e - (int) (30.6001 * f));
99 | Month = (int) (f - 1 - 12 * (f / 14));
100 | Year = (int) (d - 4715 - ((7 + Month) / 10));
101 |
102 | FracOfDay = Mjd - Math.floor(Mjd);
103 |
104 | hour = (24.0 * FracOfDay);//a dikkat/buray
105 | Minute = (int) Math.round((hour - (int) (hour)) * 60.0);
106 | //Minute =((int)(hour*60))%60;
107 | Hour = (int) hour;
108 | cal.set(Calendar.YEAR, Year);
109 | cal.set(Calendar.MONTH, Month - 1);
110 | cal.set(Calendar.DAY_OF_MONTH, Day);
111 | cal.set(Calendar.HOUR_OF_DAY, Hour);
112 | cal.set(Calendar.MINUTE, Minute);
113 | // cal.set(Year, Month, Day, Hour,0);
114 | return cal;
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/src/com/mos7af/hijri/GregorianCalendar.java:
--------------------------------------------------------------------------------
1 | package com.mos7af.hijri;
2 |
3 | public class GregorianCalendar {
4 |
5 | //utility function
6 | int intPart(int floatNum){
7 | if ((float)floatNum < -0.0000001){
8 | return (int) Math.ceil(floatNum-0.0000001);
9 | }
10 | return (int)Math.floor(floatNum +0.0000001);
11 | }
12 |
13 | //christian to islamic calendar
14 | int[] chrToIsl(int y, int m, int d, int diff) {
15 |
16 | int jd = 0;
17 | if ((y>1582)||((y==1582)&&(m>10))||((y==1582)&&(m==10)&&(d>14)))
18 | {
19 | jd=intPart((1461*(y+4800+intPart((m-14)/12)))/4)+intPart((367*(m-2-12*(intPart((m-14)/12))))/12)-
20 | intPart( (3* (intPart( (y+4900+ intPart( (m-14)/12) )/100) ) ) /4)+d-32075;
21 | }
22 | else
23 | {
24 | jd = 367*y-intPart((7*(y+5001+intPart((m-9)/7)))/4)+intPart((275*m)/9)+d+1729777;
25 | }
26 |
27 | int l=jd-1948440+10632;
28 | int n=intPart((l-1)/10631);
29 | l=l-10631*n+354+diff;
30 | int j=(intPart((10985-l)/5316))*(intPart((50*l)/17719))+(intPart(l/5670))*(intPart((43*l)/15238));
31 | l=l-(intPart((30-j)/15))*(intPart((17719*j)/50))-(intPart(j/16))*(intPart((15238*j)/43))+29;
32 | m=intPart((24*l)/709);
33 | d=l-intPart((709*m)/24);
34 | y=30*n+j-30;
35 |
36 | int[] res = new int [3];
37 | res[0] = d;
38 | res[1] = m;
39 | res[2] = y;
40 | return res;
41 | }
42 |
43 | //islamic to christian calendar
44 | int[] islToChr(int y, int m, int d, int diff) {
45 |
46 | int jd=intPart((11*y+3)/30)+354*y+30*m-intPart((m-1)/2)+d+1948440-385-diff;
47 | if (jd> 2299160 )
48 | {
49 | int l=jd+68569;
50 | int n=intPart((4*l)/146097);
51 | l=l-intPart((146097*n+3)/4);
52 | int i=intPart((4000*(l+1))/1461001);
53 | l=l-intPart((1461*i)/4)+31;
54 | int j=intPart((80*l)/2447);
55 | d=l-intPart((2447*j)/80);
56 | l=intPart(j/11);
57 | m=j+2-12*l;
58 | y=100*(n-49)+i+l;
59 | }
60 | else
61 | {
62 | int j=jd+1402;
63 | int k=intPart((j-1)/1461);
64 | int l=j-1461*k;
65 | int n=intPart((l-1)/365)-intPart(l/1461);
66 | int i=l-365*n+30;
67 | j=intPart((80*i)/2447);
68 | d=i-intPart((2447*j)/80);
69 | i=intPart(j/11);
70 | m=j+2-12*i;
71 | y=4*k+n+i-4716;
72 | }
73 |
74 | int[] res = new int [3];
75 | res[0] = d;
76 | res[1] = m;
77 | res[2] = y;
78 | return res;
79 | }
80 |
81 | //islamic calendar to string
82 | String[] isToString(int y, int m, int d, int diff){
83 | String months[] = {"Muharram","Safar","Rabi-al Awwal","Rabi-al Thani","Jumada al-Ula","Jumada al-Thani","Rajab","Sha\'ban","Ramadhan","Shawwal","Dhul Qa\'dah","Dhul Hijjah"};
84 | String monthsH[] = {"Ù…ØØ±Ù‘Ù…" ,"ØµÙØ±" ,"ربيع الأول" ,"ربيع الثاني" ,"جمادى الأولى" ,"جمادى الثاني" ,"رجب" ,"شعبان" ,"رمضان" ,"شوال" ,"ذو القعدة" ,"ذو Ø§Ù„ØØ¬Ø©"};
85 | int[] res = new int [3];
86 | res = chrToIsl(y,m,d,diff);
87 | String[] ress = new String [4];
88 | ress[0] = Integer.toString(res[0]);
89 | ress[1] = months[res[1]-1];
90 | ress[2] = monthsH[res[1]-1];
91 | ress[3] = Integer.toString(res[2]);
92 | return ress;
93 | }
94 |
95 | //christian calendar to string
96 | String[] chrToString(int y, int m, int d, int diff){
97 | String months[] = {"January","February","March","April","May","June","July","August","September","October","November","December"};
98 | int[] res = new int [3];
99 | res = islToChr(y,m,d,diff);
100 | String[] ress = new String [3];
101 | ress[0] = Integer.toString(res[0]);
102 | ress[1] = months[res[1]-1];
103 | ress[2] = Integer.toString(res[2]);
104 | return ress;
105 | }
106 | String getMonthName(int index)
107 | {
108 | String months[] = {"كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"};
109 | return months[index];
110 | }
111 | String getDayName(int index)
112 | {
113 | String days[] = {"السبت","الأحد","الأثنين","الثلاثاء","الأربعاء","الخميس","الجمعة"};
114 | return days[index];
115 | }
116 |
117 |
118 | }
119 |
--------------------------------------------------------------------------------
/gen/com/mos7af/hijri/R.java:
--------------------------------------------------------------------------------
1 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
2 | *
3 | * This class was automatically generated by the
4 | * aapt tool from the resource data it found. It
5 | * should not be modified by hand.
6 | */
7 |
8 | package com.mos7af.hijri;
9 |
10 | public final class R {
11 | public static final class attr {
12 | }
13 | public static final class drawable {
14 | public static final int appbg=0x7f020000;
15 | public static final int back=0x7f020001;
16 | public static final int background=0x7f020002;
17 | public static final int bg=0x7f020003;
18 | public static final int bg3=0x7f020004;
19 | public static final int bg4=0x7f020005;
20 | public static final int footerbg=0x7f020006;
21 | public static final int gradient_bg=0x7f020007;
22 | public static final int gradient_bg_hover=0x7f020008;
23 | public static final int ic_launcher=0x7f020009;
24 | public static final int layout_bg=0x7f02000a;
25 | public static final int screen_background=0x7f02000b;
26 | public static final int wheel_bg=0x7f02000c;
27 | public static final int wheel_val=0x7f02000d;
28 | }
29 | public static final class id {
30 | public static final int LinearLayout01=0x7f08000a;
31 | public static final int RelativeLayout01=0x7f080007;
32 | public static final int TextView01=0x7f080015;
33 | public static final int TextView02=0x7f080016;
34 | public static final int btnHijri=0x7f080011;
35 | public static final int btnMiladi=0x7f080013;
36 | public static final int btnSubmit=0x7f080008;
37 | public static final int btn_cancel=0x7f080009;
38 | public static final int day=0x7f080004;
39 | public static final int day_name=0x7f080001;
40 | public static final int digitalClock1=0x7f080002;
41 | public static final int footer=0x7f080000;
42 | public static final int linearLayout1=0x7f080003;
43 | public static final int menu_settings=0x7f080017;
44 | public static final int month=0x7f080005;
45 | public static final int text_hijri=0x7f080014;
46 | public static final int text_mili=0x7f080012;
47 | public static final int widget_day=0x7f08000b;
48 | public static final int widget_mil_day=0x7f08000e;
49 | public static final int widget_mil_month=0x7f08000f;
50 | public static final int widget_mil_month_name=0x7f080010;
51 | public static final int widget_month=0x7f08000c;
52 | public static final int widget_month_name=0x7f08000d;
53 | public static final int year=0x7f080006;
54 | }
55 | public static final class layout {
56 | public static final int date_layout=0x7f030000;
57 | public static final int ly_hijri=0x7f030001;
58 | public static final int main=0x7f030002;
59 | }
60 | public static final class menu {
61 | public static final int ly_hijri=0x7f070000;
62 | }
63 | public static final class string {
64 | public static final int app_name=0x7f050000;
65 | public static final int hello_world=0x7f050001;
66 | public static final int menu_settings=0x7f050002;
67 | }
68 | public static final class style {
69 | /**
70 | Base application theme, dependent on API level. This theme is replaced
71 | by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
72 |
73 |
74 | Theme customizations available in newer API levels can go in
75 | res/values-vXX/styles.xml, while customizations related to
76 | backward-compatibility can go here.
77 |
78 |
79 | Base application theme for API 11+. This theme completely replaces
80 | AppBaseTheme from res/values/styles.xml on API 11+ devices.
81 |
82 | API 11 theme customizations can go here.
83 |
84 | Base application theme for API 14+. This theme completely replaces
85 | AppBaseTheme from BOTH res/values/styles.xml and
86 | res/values-v11/styles.xml on API 14+ devices.
87 |
88 | API 14 theme customizations can go here.
89 | */
90 | public static final int AppBaseTheme=0x7f060000;
91 | /** Application theme.
92 | All customizations that are NOT specific to a particular API-level can go here.
93 | */
94 | public static final int AppTheme=0x7f060001;
95 | }
96 | public static final class xml {
97 | public static final int watch_widget_provider=0x7f040000;
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/src/com/mos7af/hijri/APC_Math.java:
--------------------------------------------------------------------------------
1 | package com.mos7af.hijri;
2 |
3 | /**
4 | *
5 | * @author http://www.cepmuvakkit.com
6 | */
7 | public class APC_Math {
8 | //------------------------------------------------------------------------------
9 | //
10 | // Frac: Gives the fractional part of a number
11 | //
12 | //------------------------------------------------------------------------------
13 |
14 | static double Frac(double x) {
15 |
16 | return x - (long) x;
17 | }
18 |
19 | //------------------------------------------------------------------------------
20 | //
21 | // Ddd: Conversion of angular degrees, minutes and seconds of arc to decimal
22 | // representation of an angle
23 | //
24 | // Input:
25 | //
26 | // D Angular degrees
27 | // M Minutes of arc
28 | // S Seconds of arc
29 | //
30 | // : Angle in decimal representation
31 | //*BU*
32 | //------------------------------------------------------------------------------
33 | static double Ddd(int D, int M, double S) {
34 | //
35 | // Variables
36 | //
37 | double sign;
38 |
39 |
40 | if ((D < 0) || (M < 0) || (S < 0)) {
41 | sign = -1.0;
42 | } else {
43 | sign = 1.0;
44 | }
45 |
46 | return sign * (Math.abs(D) + Math.abs(M) / 60.0 + Math.abs(S) / 3600.0);
47 | }
48 | //------------------------------------------------------------------------------
49 | //
50 | // Pegasus: Root finder using the Pegasus method
51 | //
52 | // Input:
53 | //
54 | // PegasusFunct Pointer to the function to be examined
55 | //
56 | // LowerBound Lower bound of search interval
57 | // UpperBound Upper bound of search interval
58 | // Accuracy Desired accuracy for the root
59 | //
60 | // Output:
61 | //
62 | // Root Root found (valid only if Success is true)
63 | // Success Flag indicating success of the routine
64 | //
65 | // References:
66 | //
67 | // Dowell M., Jarratt P., 'A modified Regula Falsi Method for Computing
68 | // the root of an equation', BIT 11, p.168-174 (1971).
69 | // Dowell M., Jarratt P., 'The "PEGASUS Method for Computing the root
70 | // of an equation', BIT 12, p.503-508 (1972).
71 | // G.Engeln-Muellges, F.Reutter, 'Formelsammlung zur Numerischen
72 | // Mathematik mit FORTRAN77-Programmen', Bibliogr. Institut,
73 | // Zuerich (1986).
74 | //
75 | // Notes:
76 | //
77 | // Pegasus assumes that the root to be found is bracketed in the interval
78 | // [LowerBound, UpperBound]. Ordinates for these abscissae must therefore
79 | // have different signs.
80 | //
81 | //------------------------------------------------------------------------------
82 | public static double Pegasus(MoonPhases moonPhase, double LowerBound, double UpperBound, double Accuracy, boolean[] Success) {
83 |
84 |
85 | double x1 = LowerBound;
86 | double x2 = UpperBound;
87 | double f1 = moonPhase.calculatePhase(x1);
88 | double f2 = moonPhase.calculatePhase(x2);
89 | double x3, f3, Root;
90 | int MaxIterat = 30;
91 |
92 | int Iterat = 0;
93 |
94 | // Initialization
95 | Success[0] = false;
96 | Root = x1;
97 |
98 |
99 | // Iteration
100 | if (f1 * f2 < 0.0) {
101 | do {
102 | // Approximation of the root by interpolation
103 | x3 = x2 - f2 / ((f2 - f1) / (x2 - x1));
104 | f3 = moonPhase.calculatePhase(x3);
105 |
106 | // Replace (x1,f2) and (x2,f2) by new values, such that
107 | // the root is again within the interval [x1,x2]
108 | if (f3 * f2 <= 0.0) {
109 | // Root in [x2,x3]
110 | x1 = x2;
111 | f1 = f2; // Replace (x1,f1) by (x2,f2)
112 | x2 = x3;
113 | f2 = f3; // Replace (x2,f2) by (x3,f3)
114 | } else {
115 | // Root in [x1,x3]
116 | f1 = f1 * f2 / (f2 + f3); // Replace (x1,f1) by (x1,f1')
117 | x2 = x3;
118 | f2 = f3; // Replace (x2,f2) by (x3,f3)
119 | }
120 |
121 | if (Math.abs(f1) < Math.abs(f2)) {
122 | Root = x1;
123 | } else {
124 | Root = x2;
125 | }
126 |
127 | Success[0] = (Math.abs(x2 - x1) <= Accuracy);
128 | Iterat++;
129 | } while (!Success[0] && (Iterat < MaxIterat));
130 | }
131 |
132 | return Root;
133 | }
134 | }
135 |
136 |
137 |
138 |
--------------------------------------------------------------------------------
/src/com/mos7af/hijri/DateActivity.java:
--------------------------------------------------------------------------------
1 | package com.mos7af.hijri;
2 |
3 | import java.util.Calendar;
4 |
5 | import com.mos7af.hijri.OnWheelChangedListener;
6 | import com.mos7af.hijri.WheelView;
7 | import com.mos7af.hijri.adapters.ArrayWheelAdapter;
8 | import com.mos7af.hijri.adapters.NumericWheelAdapter;
9 |
10 |
11 |
12 |
13 | import android.app.Activity;
14 | import android.content.Context;
15 | import android.content.Intent;
16 | import android.graphics.Typeface;
17 | import android.os.Bundle;
18 | import android.view.View;
19 | import android.view.ViewGroup;
20 | import android.widget.Button;
21 | import android.widget.TextView;
22 | import android.widget.Toast;
23 |
24 | public class DateActivity extends Activity {
25 |
26 | public static int sel_year ;
27 | public static int sel_month;
28 | public static int sel_day ;
29 | int minimum_year = 623;
30 | public static boolean isHijri = false;
31 | @Override
32 | public void onCreate(Bundle savedInstanceState) {
33 | super.onCreate(savedInstanceState);
34 | setContentView(R.layout.date_layout);
35 |
36 | Calendar calendar = Calendar.getInstance();
37 |
38 | final WheelView month = (WheelView) findViewById(R.id.month);
39 | final WheelView year = (WheelView) findViewById(R.id.year);
40 | final WheelView day = (WheelView) findViewById(R.id.day);
41 |
42 | OnWheelChangedListener listener = new OnWheelChangedListener() {
43 | public void onChanged(WheelView wheel, int oldValue, int newValue) {
44 | updateDays(year, month, day);
45 | }
46 | };
47 |
48 | // month
49 | int curMonth = sel_month;
50 | String months[] = new String[] {"كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"};
51 | if(isHijri)
52 | months = new String[] {"محرم", "صفر", "ربيع الأول", "ربيع الآخر","جمادى الأولى", "جمادى الآخرة", "رجب", "شعبان","رمضان", "شوال", "ذو القعدة", "ذو الحجة"};
53 |
54 |
55 | month.setViewAdapter(new DateArrayAdapter(this, months, curMonth));
56 | month.setCurrentItem(curMonth);
57 | month.addChangingListener(listener);
58 |
59 | // year
60 | int curYear = sel_year;
61 | year.setViewAdapter(new DateNumericAdapter(this, minimum_year, 2500, curYear-minimum_year));
62 | year.setCurrentItem(curYear-minimum_year);
63 | year.addChangingListener(listener);
64 |
65 |
66 | //day
67 | day.setCurrentItem(sel_day);
68 | updateDays(year, month, day);
69 | day.setCurrentItem(sel_day);
70 |
71 | Button btnSubmit = (Button) findViewById(R.id.btnSubmit);
72 | btnSubmit.setOnClickListener(new View.OnClickListener() {
73 | @Override
74 | public void onClick(View v) {
75 |
76 |
77 | DateActivity.sel_year = year.getCurrentItem()+minimum_year;
78 | DateActivity.sel_month = month.getCurrentItem();
79 | DateActivity.sel_day = day.getCurrentItem();
80 |
81 | Intent in = new Intent(getApplicationContext(),
82 | Hijri.class);
83 | setResult(100, in);
84 | finish();
85 |
86 | }
87 | });
88 | Button btn_cancel = (Button) findViewById(R.id.btn_cancel);
89 | btn_cancel.setOnClickListener(new View.OnClickListener() {
90 | @Override
91 | public void onClick(View v) {
92 |
93 |
94 | Intent in = new Intent(getApplicationContext(),
95 | Hijri.class);
96 | setResult(200, in);
97 | finish();
98 |
99 | }
100 | });
101 | }
102 |
103 | /**
104 | * Updates day wheel. Sets max days according to selected month and year
105 | */
106 | void updateDays(WheelView year, WheelView month, WheelView day) {
107 | Calendar calendar = Calendar.getInstance();
108 | calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) + year.getCurrentItem());
109 | calendar.set(Calendar.MONTH, month.getCurrentItem());
110 |
111 | int maxDays = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
112 | day.setViewAdapter(new DateNumericAdapter(this, 1, maxDays, sel_day));
113 | int curDay = Math.min(maxDays, day.getCurrentItem() + 1);
114 | day.setCurrentItem(curDay - 1, true);
115 | //day.setCurrentItem(sel_day);
116 | }
117 |
118 | /**
119 | * Adapter for numeric wheels. Highlights the current value.
120 | */
121 | private class DateNumericAdapter extends NumericWheelAdapter {
122 | // Index of current item
123 | int currentItem;
124 | // Index of item to be highlighted
125 | int currentValue;
126 |
127 | /**
128 | * Constructor
129 | */
130 | public DateNumericAdapter(Context context, int minValue, int maxValue, int current) {
131 | super(context, minValue, maxValue);
132 | this.currentValue = current;
133 | setTextSize(16);
134 | }
135 |
136 | @Override
137 | protected void configureTextView(TextView view) {
138 | super.configureTextView(view);
139 | if (currentItem == currentValue) {
140 | view.setTextColor(0xFF0000F0);
141 | }
142 | view.setTypeface(Typeface.SANS_SERIF);
143 | }
144 |
145 | @Override
146 | public View getItem(int index, View cachedView, ViewGroup parent) {
147 | currentItem = index;
148 | return super.getItem(index, cachedView, parent);
149 | }
150 | }
151 |
152 | /**
153 | * Adapter for string based wheel. Highlights the current value.
154 | */
155 | private class DateArrayAdapter extends ArrayWheelAdapter {
156 | // Index of current item
157 | int currentItem;
158 | // Index of item to be highlighted
159 | int currentValue;
160 |
161 | /**
162 | * Constructor
163 | */
164 | public DateArrayAdapter(Context context, String[] items, int current) {
165 | super(context, items);
166 | this.currentValue = current;
167 | setTextSize(16);
168 | }
169 |
170 | @Override
171 | protected void configureTextView(TextView view) {
172 | super.configureTextView(view);
173 | if (currentItem == currentValue) {
174 | view.setTextColor(0xFF0000F0);
175 | }
176 | view.setTypeface(Typeface.SANS_SERIF);
177 | }
178 |
179 | @Override
180 | public View getItem(int index, View cachedView, ViewGroup parent) {
181 | currentItem = index;
182 | return super.getItem(index, cachedView, parent);
183 | }
184 | }
185 | }
186 |
--------------------------------------------------------------------------------
/src/com/mos7af/hijri/HijriCalendar.java:
--------------------------------------------------------------------------------
1 | package com.mos7af.hijri;
2 |
3 | import java.util.Calendar;
4 | /**
5 | * @author http://www.cepmuvakkit.com
6 | */
7 | public class HijriCalendar {
8 |
9 | private Calendar cal;
10 | private double MJD;
11 | private String ismiSuhiri[] = {
12 | "محرم", "صفر", "ربيع الأول", "ربيع الآخر",
13 | "جمادى الأولى", "جمادى الآخرة", "رجب", "شعبان",
14 | "رمضان", "شوال", "ذو القعدة", "ذو الحجة"};
15 | private int Lunation;
16 | private int hijriYear, hijriMonth, hijriDay;
17 | private boolean[] isFound;
18 | private double newMoonMoment; //Calculated time for the New Moon in ModifiedJulianDays UTC
19 | private double crescentMoonMoment; // Calculated time for the Crescent Moon in ModifiedJulianDays UTC
20 | final double synmonth = 29.530588861;// Synodic Month Period
21 | final double dT = 7.0 / 36525.0; // Step (1 week)
22 | final double dTc = 3.0 / 36525.0; // Step (3 days)
23 | final double Acc = (0.5 / 1440.0) / 36525.0; // Desired Accuracy (0.5 min)
24 | final double MJD_J2000 = 51544.5;
25 | final double MLunatBase = 23435.90347;
26 | // Modified Base date for E. W. Brown's numbered series of
27 | // lunations (1923 January 16 02:41) 2423436-2400000.5=23435.5
28 | // 2423436.40347 23435,9034699998
29 | // which is solved according to the 8 degrees elongation angle.
30 | // private double timeDifferenceforET_UT; // Correction variable due to difference of ephemeris time and universal time
31 |
32 | public HijriCalendar(int Year, int Month, int Day) {
33 |
34 | this.MJD = APC_Time.Mjd(Year, Month, Day, 0, 0, 0);
35 | cal = APC_Time.CalDat(MJD);
36 |
37 | double Tnow, T0, T1, TNewMoon, TCrescent; // Time( Ephemeris:disabled) in Julian centuries since J2000
38 | double D0, D1;
39 | Tnow = (MJD - MJD_J2000) / 36525.0;
40 | T1 = Tnow;
41 | T0 = T1 - dT; // decrease 1 week
42 | isFound = new boolean[1];
43 | isFound[0] = false;
44 | // Search for phases bracket desired phase event
45 | MoonPhases newMoon = new NewMoon();
46 | MoonPhases crescentMoon = new CrescentMoon();
47 | D1 = newMoon.calculatePhase(T1);
48 | D0 = newMoon.calculatePhase(T0);
49 | while ((D0 * D1 > 0.0) || (D1 < D0)) {
50 | T1 = T0;
51 | D1 = D0;
52 | T0 -= dT;
53 | D0 = newMoon.calculatePhase(T0);//Finds correct week for iteration
54 | }
55 | // Iterate NewMoon time
56 | TNewMoon = APC_Math.Pegasus(newMoon, T0, T1, Acc, isFound);
57 | // Correct for difference of ephemeris time and universal time currently disabled
58 | // ETminUT ( TPhase, ET_UT, valid );
59 | newMoonMoment = (TNewMoon * 36525.0 + MJD_J2000);// - ET_UT/86400.0;
60 | Lunation = (int) Math.floor((newMoonMoment + 7 - MLunatBase) / synmonth) + 1;
61 | // 1341 (29 CemuzuyelEvvel) is the hicri day for the 17 January 1923
62 | // which is the start day of the Brown's Lunation Number;
63 | hijriYear = (Lunation + 4) / 12 + 1341;
64 | // Returns 1 for Muharrem 2 for Safer .... 12 for Zilhicce
65 | hijriMonth = (Lunation + 4) % 12 + 1;
66 | if (isFound[0]) {
67 | TCrescent = APC_Math.Pegasus(crescentMoon, TNewMoon, TNewMoon + dTc, Acc, isFound);
68 | crescentMoonMoment = TCrescent * 36525.0 + MJD_J2000;
69 | }
70 | hijriDay = (int) (MJD - Math.round(crescentMoonMoment + 0.279166666666667)) + 1;
71 | //0.279166666666667 comes from the hours 5:18 am
72 | if (hijriDay == 0) {
73 | hijriDay = 30;
74 | hijriMonth--;
75 | if (hijriMonth == 0) {
76 | hijriMonth = 12;
77 | }
78 | }
79 |
80 |
81 | }
82 |
83 | public int getHijriYear() {
84 | return hijriYear;
85 | }
86 |
87 | public String getHijriMonthName() {
88 | return ismiSuhiri[(hijriMonth - 1)];
89 | }
90 |
91 | public int getHijriMonth() {
92 |
93 | return hijriMonth;
94 | }
95 |
96 | public int getHijriDay() {
97 | return hijriDay;
98 | }
99 |
100 | public String getHicriTakvim() {
101 | return getHijriDay() + " " + getHijriMonthName() + " " + getHijriYear();
102 | }
103 |
104 | /**
105 | * 1 Muharrem=Hijri New Year
106 | * 10 Muharrem= Day of Ashura
107 | * 11/12 Rebiulevvel= Mawlid-al Nabi
108 | * 1 Recep=Start of Holy Months
109 | * 1st Cuma day on Recep= Lailatul-Raghaib
110 | * 27 Recep=Lailatul-Me'rac
111 | * 14/15 Nisfu-Sha'aban
112 | * 1 Ramadhan=1. Day of Ramadhan
113 | * 27 Ramadhan= Lailatul-Qadr
114 | * 1 Sevval=1. Day of Eid-al-Fitr
115 | * 2 Sevval=2. Day of Eid-al-Fitr
116 | * 3 Sevval=3. Day of Eid-al-Fitr
117 | * 9 ZiLHiCCE= A'rafa
118 | * 10 Zilhicce= 1. Day of Eid-al-Adha
119 | * 11 Zilhicce= 2. Day of Eid-al-Adha
120 | * 12 Zilhicce= 3. Day of Eid-al-Adha
121 | * 13 Zilhicce= 4. Day of Eid-al-Adha
122 | * @return
123 | */
124 | public String checkIfHolyDay() {
125 | String holyDay = "";
126 | switch (hijriMonth) {
127 | case 1:
128 | if (hijriDay == 1) {
129 | holyDay = "NEWYEAR";
130 | } else if (hijriDay == 10) {
131 | holyDay = "ASHURA";
132 | }
133 | break;
134 | case 3:
135 | if ((hijriDay == 11) || (hijriDay == 12)) {
136 | holyDay = "MAWLID";
137 | }
138 | break;
139 | case 7:
140 | if ((hijriDay == 1) && (hijriMonth == 7)) {
141 | holyDay = "HOLYMONTHS";
142 | }
143 | if ((cal.get(Calendar.DAY_OF_WEEK) == 6) && (hijriDay < 7)) {
144 | holyDay = "RAGHAIB";
145 | }
146 | if (hijriDay == 27) {
147 | holyDay = "MERAC";
148 | }
149 | break;
150 | case 8:
151 | if (/*(hijriDay==14)||*/(hijriDay == 15)) {
152 | holyDay = "BARAAT";
153 | }
154 | break;
155 | case 9:
156 | if ((hijriDay == 27)) {
157 | holyDay = "QADR";
158 | }
159 | break;
160 | case 10:
161 | if ((hijriDay == 1) || (hijriDay == 2) || (hijriDay == 3)) {
162 | holyDay = hijriDay + "DAYOFEIDFITR";
163 | }
164 | break;
165 |
166 | case 12:
167 | if (hijriDay == 9) {
168 | holyDay = "AREFE";
169 | }
170 | if ((hijriDay == 10) || (hijriDay == 11) || (hijriDay == 12) || (hijriDay == 13)) {
171 | holyDay = (hijriDay - 9) + "DAYOFEIDAHDA";
172 | }
173 | break;
174 | }
175 |
176 | return holyDay;
177 |
178 |
179 | }
180 |
181 | public String getDay() {
182 | String daysName[] = {"SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY"};
183 | return daysName[cal.get(Calendar.DAY_OF_WEEK) - 1];
184 |
185 | }
186 |
187 |
188 |
189 | }
190 |
--------------------------------------------------------------------------------
/src/com/mos7af/hijri/Hijri.java:
--------------------------------------------------------------------------------
1 | package com.mos7af.hijri;
2 |
3 | import java.util.Calendar;
4 |
5 |
6 |
7 | import android.os.Bundle;
8 | import android.app.Activity;
9 |
10 | import android.app.DatePickerDialog;
11 | import android.content.Intent;
12 |
13 | import android.graphics.Typeface;
14 |
15 | import android.text.format.DateFormat;
16 | import android.text.format.Time;
17 |
18 | import android.view.Menu;
19 | import android.view.View;
20 |
21 | import android.widget.Button;
22 | import android.widget.DatePicker;
23 | import android.widget.DigitalClock;
24 | import android.widget.RelativeLayout;
25 | import android.widget.Toast;
26 |
27 | import android.widget.TextView;
28 | import java.lang.reflect.Field;
29 |
30 |
31 | import com.mos7af.hijri.WheelView;
32 |
33 | public class Hijri extends Activity {
34 |
35 | Calendar calendar;
36 | Typeface tf;
37 | @Override
38 | protected void onCreate(Bundle savedInstanceState) {
39 | super.onCreate(savedInstanceState);
40 | setContentView(R.layout.ly_hijri);
41 | String fontPath = "fonts/hallfetica.ttf";
42 |
43 | tf = Typeface.createFromAsset(
44 | Hijri.this.getAssets(), fontPath);
45 |
46 | calendar = Calendar.getInstance();
47 |
48 |
49 | HijriCalendar hijriCalendar =new HijriCalendar(calendar.get(Calendar.YEAR),calendar.get(Calendar.MONTH)+1,calendar.get(Calendar.DAY_OF_MONTH));
50 | String hijriDate=hijriCalendar.getHicriTakvim();
51 | String hijriDay=Integer.toString( hijriCalendar.getHijriDay());
52 | String hijriMonth=Integer.toString( hijriCalendar.getHijriMonth());//hijriCalendar.getHijriMonthName();
53 | String hijriyear=Integer.toString( hijriCalendar.getHijriYear());
54 | String hijriMonthName = hijriCalendar.getHijriMonthName();
55 | TextView widget_day = (TextView)findViewById(R.id.widget_day);
56 | TextView widget_month = (TextView)findViewById(R.id.widget_month);
57 | TextView widget_month_name = (TextView)findViewById(R.id.widget_month_name);
58 |
59 | widget_day.setText(hijriDay);
60 |
61 | widget_month.setText(hijriMonth +" , " + hijriyear);
62 | widget_month_name.setText(hijriMonthName);
63 | widget_day.setTypeface(tf);
64 | widget_month.setTypeface(tf);
65 |
66 |
67 | TextView text_hijri = (TextView)findViewById(R.id.text_hijri);
68 | text_hijri.setTypeface(tf);
69 | text_hijri.setText(hijriDay+ " , "+hijriMonth +" , " + hijriyear);
70 |
71 |
72 | GregorianCalendar g= new GregorianCalendar();
73 |
74 | TextView widget_mil_day = (TextView)findViewById(R.id.widget_mil_day);
75 | TextView widget_mil_month = (TextView)findViewById(R.id.widget_mil_month);
76 | TextView widget_mil_month_name = (TextView)findViewById(R.id.widget_mil_month_name);
77 |
78 | widget_mil_month_name.setText( g.getMonthName(calendar.get(Calendar.MONTH)));
79 | widget_mil_day.setText( Integer.toString(calendar.get(Calendar.DAY_OF_MONTH)));
80 | widget_mil_day.setTypeface(tf);
81 | widget_mil_month.setText( Integer.toString( calendar.get(Calendar.MONTH)+1)+" , "+Integer.toString(calendar.get(Calendar.YEAR)));
82 | widget_mil_month.setTypeface(tf);
83 | TextView day_name = (TextView)findViewById(R.id.day_name);
84 |
85 | day_name.setTypeface(tf);
86 | day_name.setText( g.getDayName(calendar.get(Calendar.DAY_OF_WEEK)));
87 |
88 | DigitalClock digitalClock=(DigitalClock)findViewById(R.id.digitalClock1);
89 | digitalClock.setTypeface(tf);
90 |
91 | TextView text_mili = (TextView)findViewById(R.id.text_mili);
92 | text_mili.setTypeface(tf);
93 | text_mili.setText(Integer.toString(calendar.get(Calendar.DAY_OF_MONTH))+" , "+ Integer.toString( calendar.get(Calendar.MONTH)+1)+" , "+Integer.toString(calendar.get(Calendar.YEAR)));
94 |
95 |
96 | mili_year = calendar.get(Calendar.YEAR);
97 | mili_month = calendar.get(Calendar.MONTH);
98 | mili_day = calendar.get(Calendar.DAY_OF_MONTH);
99 |
100 | hijri_year = hijriCalendar.getHijriYear();
101 | hijri_month = hijriCalendar.getHijriMonth();
102 | hijri_day = hijriCalendar.getHijriDay();
103 |
104 |
105 | Button btnHijri = (Button) findViewById(R.id.btnHijri);
106 | btnHijri.setOnClickListener(new View.OnClickListener() {
107 | @Override
108 | public void onClick(View v) {
109 | // abed();
110 | DateActivity.isHijri = false;
111 | DateActivity.sel_year = mili_year;
112 | DateActivity.sel_month = mili_month;
113 | DateActivity.sel_day = mili_day-1;
114 |
115 | Intent i = new Intent(getApplicationContext(), DateActivity.class);
116 | startActivityForResult(i, 100);
117 |
118 | }
119 | });
120 |
121 | Button btnMiladi = (Button) findViewById(R.id.btnMiladi);
122 | btnMiladi.setOnClickListener(new View.OnClickListener() {
123 | @Override
124 | public void onClick(View v) {
125 |
126 | DateActivity.isHijri = true;
127 | DateActivity.sel_year = hijri_year;
128 | DateActivity.sel_month = hijri_month-1;
129 | DateActivity.sel_day = hijri_day-1;
130 |
131 | Intent i = new Intent(getApplicationContext(), DateActivity.class);
132 | startActivityForResult(i, 100);
133 |
134 | }
135 | });
136 |
137 | }
138 |
139 |
140 | int hijri_year;
141 | int hijri_month;
142 | int hijri_day;
143 | private void SetHijriDate(int year,int month,int day)
144 | {
145 | hijri_year = year;
146 | hijri_month = month;
147 | hijri_day = day;
148 |
149 |
150 | TextView text_hijri = (TextView)findViewById(R.id.text_hijri);
151 | text_hijri.setTypeface(tf);
152 | text_hijri.setText(Integer.toString(day)+" , "+ Integer.toString( month)+" , "+Integer.toString(year));
153 | //SetMiliDate(year,month,day);
154 | }
155 | int mili_year;
156 | int mili_month;
157 | int mili_day;
158 | private void SetMiliDate(int year,int month,int day)
159 | {
160 | mili_year = year;
161 | mili_month = month;
162 | mili_day = day;
163 |
164 |
165 | TextView text_mili = (TextView)findViewById(R.id.text_mili);
166 | text_mili.setTypeface(tf);
167 | text_mili.setText(Integer.toString(day)+" , "+ Integer.toString( month+1)+" , "+Integer.toString(year));
168 |
169 | }
170 |
171 |
172 | @Override
173 | protected void onActivityResult(int requestCode,
174 | int resultCode, Intent data) {
175 | super.onActivityResult(requestCode, resultCode, data);
176 | if(resultCode == 100){
177 | if(!DateActivity.isHijri)
178 | {
179 | SetMiliDate(DateActivity.sel_year,DateActivity.sel_month,DateActivity.sel_day+1);
180 | HijriCalendar hijriCalendar =new HijriCalendar(DateActivity.sel_year,DateActivity.sel_month+1,DateActivity.sel_day+1);
181 | String hijriDate=hijriCalendar.getHicriTakvim();
182 | SetHijriDate(hijriCalendar.getHijriYear(),hijriCalendar.getHijriMonth(),hijriCalendar.getHijriDay());
183 | }else
184 | {
185 | GregorianCalendar g= new GregorianCalendar();
186 | int[] res = g.islToChr(DateActivity.sel_year,DateActivity.sel_month,DateActivity.sel_day+1, 0);
187 | SetMiliDate(res[2],res[1],res[0]);
188 | SetHijriDate(DateActivity.sel_year,DateActivity.sel_month+1,DateActivity.sel_day+1);
189 | }
190 | }
191 |
192 | }
193 |
194 |
195 | }
196 |
--------------------------------------------------------------------------------
/res/layout/ly_hijri.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
16 |
17 |
29 |
30 |
41 |
42 |
43 |
44 |
53 |
54 |
65 |
66 |
79 |
80 |
92 |
93 |
94 |
103 |
104 |
115 |
116 |
129 |
130 |
142 |
143 |
144 |
156 |
157 |
167 |
168 |
184 |
185 |
195 |
196 |
212 |
213 |
214 |
215 |
229 |
230 |
242 |
243 |
--------------------------------------------------------------------------------