-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
687 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.idea/ | ||
.DS_Store | ||
/build | ||
/captures | ||
/.idea/caches/build_file_checksums.ser |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
app/src/main/java/com/hornet/nepalidateconverter/CalendarActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.hornet.nepalidateconverter; | ||
|
||
import android.annotation.SuppressLint; | ||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.view.View; | ||
import android.widget.TextView; | ||
import android.widget.Toast; | ||
|
||
import com.hornet.dateconverter.CalendarView.Calendar; | ||
import com.hornet.dateconverter.DateConverter; | ||
import com.hornet.dateconverter.Model; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class CalendarActivity extends AppCompatActivity implements com.hornet.dateconverter.CalendarView.Calendar.OnDateSetListener { | ||
Calendar mCalendar; | ||
DateConverter dateConverter; | ||
TextView textOutput; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_calendar); | ||
dateConverter = new DateConverter(); | ||
mCalendar = findViewById(R.id.calendar); | ||
textOutput = findViewById(R.id.textOutput); | ||
mCalendar.setOnDateSetListener(this); | ||
mCalendar.setHighlightedDays(DateConverter.getAllSaturdays()); | ||
setTitle("Nepali Calendar"); | ||
} | ||
|
||
@SuppressLint("SetTextI18n") | ||
@Override | ||
public void onDateClick(View calendar, int year, int month, int day) { | ||
textOutput.setText("year :: " + year + " month :: " + (month + 1) + " day :: " + day); | ||
} | ||
|
||
/** | ||
* get List of sample model of date | ||
* | ||
* @return ArrayList<Model> | ||
*/ | ||
public List<Model> getSampleModelList() { | ||
List<Model> myList = new ArrayList<>(); | ||
for (int i = 2; i < 15; i++) { | ||
myList.add(new Model(dateConverter.getTodayNepaliDate().getYear(), dateConverter.getTodayNepaliDate().getMonth(), (i + 2))); | ||
} | ||
return myList; | ||
} | ||
|
||
} |
Oops, something went wrong.