Skip to content

Instantly share code, notes, and snippets.

View rahulupadhyay's full-sized avatar

Rahul Upadhyay rahulupadhyay

View GitHub Profile
@rahulupadhyay
rahulupadhyay / WriteFile.java
Created August 9, 2016 05:22
Create a CSV file using java with Calendar to create directories
Calendar c = Calendar.getInstance();
int mon = (c.get(Calendar.MONTH))+1;
String monthpath = ""+mon;
String yearpath=""+c.get(Calendar.YEAR);
String datepath=""+c.get(Calendar.DATE);
String monthyear = monthpath.trim()+" "+yearpath.trim();
int i=1;
Boolean check = isSdPresent();
@Override
public void onConnected(@Nullable Bundle bundle) {
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
@rahulupadhyay
rahulupadhyay / activity_scrolling.xml
Created April 22, 2016 07:20
NestedSrollView with RecyclerView inside it along with TextView.
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.devdigital.rundedcardwithimagedemo.ScrollingActivity">
<android.support.design.widget.AppBarLayout
import android.widget.ListView;
import android.widget.AbsListView;
import android.content.Context;
public class HalfCircleListView extends ListView implements AbsListView.OnScrollListener {
public HalfCircleListView(Context context) {
super(context);
setOnScrollListener(this);
}
package com.eclipsesource.overlay;
public class Entry {
private final int imageResId;
private final String title;
private final int id;
public Entry( int imageResId, String title, int id ) {