Skip to content

Instantly share code, notes, and snippets.

View gotoark's full-sized avatar
🎯
Focusing

RAJESH KUMAR ARUMUGAM gotoark

🎯
Focusing
View GitHub Profile
@gotoark
gotoark / Fragment.txt
Created October 13, 2017 09:44
Get view of fragments in View Pager
Main Activity....
TabFragment tabFragment= (TabFragment) mFragmentManager.getFragments().get(0);
ViewPager viewPager=tabFragment.getViewPager();
View todView= viewPager.getChildAt(0);
View htView= viewPager.getChildAt(1);
View DTview= viewPager.getChildAt(2);
Log.d(TAG, "onClick Save 1: -------------------------------------"+((EditText)(todView.findViewById(R.id.ET_readingDate))).getText().toString());
Log.d(TAG, "onClick Save 2: -------------------------------------"+((EditText)(htView.findViewById(R.id.ET_readingdate_LT))).getText().toString());
Log.d(TAG, "onClick Save 3: -------------------------------------"+((EditText)(DTview.findViewById(R.id.ET_readingdate_DT))).getText().toString());
@gotoark
gotoark / SendCustomeasIntent.txt
Created October 7, 2017 11:49
Send Custome List Between Activities
1. Implements Parcellable
public class Consumer implements Parcelable {
......
}
2.Add it to Intents
Intent intent=new Intent(getApplicationContext(),ConsumerDetails.class);
intent.putExtra("consumerList", (ArrayList<Consumer>) ConsumersList);
@gotoark
gotoark / DateOfBirthValidation.js
Created August 23, 2017 07:14
DateOfBirthValidation in JS
$(function() {
$(".datepicker").datepicker();
$("#dateOfBirth").change(function() {
var dob = $(this).datepicker("getDate");
var today = new Date();
var age = today.getFullYear() - dob.getFullYear();
$("#age").val(age);
//Check Minimum Age
if (age < 18) {
//alert("Age should be more than 18 years");
@gotoark
gotoark / dependentDropDown.jsp
Created August 11, 2017 10:24
Dependent Drop Downs JS Ref for Spring JSP
//Add Hidden Value
<form:input path="preDist" type="hidden" maxlength="50" id="temppreDist" />
<script>
jQuery(document).ready(function() {
//Assign Dependent Drop Downs
assignDependentDropDowns();
});
function assignDependentDropDowns(){
@gotoark
gotoark / timeNow.js
Created August 11, 2017 06:16
Get Current Time in Javascript Original Source : https://stackoverflow.com/a/18229123/5740760
function checkTime(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
function startTime() {
var today = new Date();
var h = today.getHours();
@gotoark
gotoark / SelectOptionBasedonCustomTag.js
Created August 10, 2017 09:53
SelectOptionBasedonCustomTag
var option = $('option:selected', this).attr('mytag');
@gotoark
gotoark / LeapYear.js
Last active August 10, 2017 09:53
LeapYear.js
function leapYear(year)
{
return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
}
@gotoark
gotoark / DateCompUtil.js
Created July 28, 2017 07:45
DateComparison in Javascript
function Stringtodate(inputDate)
{
var splittedDate = inputDate.split("/");
var date=new Date();
date.setDate(splittedDate[0]);
date.setMonth(splittedDate[1]-1); //in js month range 0-11
date.setFullYear(splittedDate[2]);
return date;
}
@gotoark
gotoark / README.md
Created July 4, 2017 18:09 — forked from lopspower/README.md
Testing activity in Android Studio

Testing activity in Android Studio

How we build the app

Before we start writing our first UI test I want to describe our development process.

  1. First, we write a test for a UI or logic that does not yet exist.
  2. We expect to see build errors or failed tests.
  3. Then we create a UI element or write program logic.
  4. Finally, we run the test and make sure it passes.
@gotoark
gotoark / unity3tutoriallist.md
Created June 9, 2017 10:27 — forked from gersande/unity3tutoriallist.md
Unity Tutorial List for 2D Games