Skip to content

Instantly share code, notes, and snippets.

@creativedrewy
creativedrewy / CustomDatePicker.kt
Last active April 15, 2022 12:45 — forked from izmajlowiczl/CustomDatePicker.java
Date/Time Picker fix for ScrollView - Kotlin
package com.myproject.myapp.myviews
import android.content.Context
import android.util.AttributeSet
import android.view.MotionEvent
import android.widget.DatePicker
/**
* Extended DatePicker to allow for year-selection scrolling within a scrollview
*/
@alphamu
alphamu / Android Privacy Policy Template
Created February 9, 2017 03:17
A template for creating your own privacy policy for Android apps. Look for "[" and "<!--" to see where you need to edit this app in order to create your own privacy olicy.
<html>
<body>
<h2>Privacy Policy</h2>
<p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and
disclosure of Personal Information if anyone decided to use [my|our] Service.</p>
<p>If you choose to use [my|our] Service, then you agree to the collection and use of information in
relation with this policy. The Personal Information that [I|we] collect are used for providing and
improving the Service. [I|We] will not use or share your information with anyone except as described
@skyfishjy
skyfishjy / CursorRecyclerViewAdapter.java
Last active December 16, 2023 08:55
CursorRecyclerViewAdapter
/*
* Copyright (C) 2014 skyfish.jy@gmail.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@gabrielemariotti
gabrielemariotti / Readme.md
Last active March 2, 2024 23:10
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@LindsayBradford
LindsayBradford / build.gradle
Last active February 26, 2019 14:39
Gradle script for LaTeX pdf generation.
/*
* Usage:
* all LaTeX source files go in $rawDirectory
* base document to 'cook' should match content of $latexFile
* build script delivers resulting PDF file to $cookedDirectory
*/
defaultTasks 'full'
ext { documentBase = 'myBaseLaTeXFileName' }
@commonsguy
commonsguy / gif2animdraw
Last active May 1, 2023 14:26
Ruby script to convert animated GIF into an Android AnimationDrawable
#!/usr/bin/ruby
require 'fileutils'
require 'RMagick'
require 'slop'
require 'builder'
opts = Slop.new do
banner "gif2animdraw [options]\n"
on :i, :input=, 'path to animated GIF (or directory of GIFs)', :required => true
on :o, :outdir=, 'path to root output directory', :required => true
@izmajlowiczl
izmajlowiczl / CustomDatePicker.java
Created September 20, 2013 04:16
Date/Time Picker fix for ScrollView
package com.mydriver.customer.ui.common.custom;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewParent;
import android.widget.DatePicker;
/**
public class MainActivity extends ActionBarActivity {
private String[] mPlanetTitles;
private DrawerLayout mDrawerLayout;
private ListView mDrawerList;
private CharSequence mTitle;
private ActionBarDrawerToggle mDrawerToggle;
@Override
protected void onCreate(Bundle savedInstanceState) {
@aprock
aprock / RoundedTransformation.java
Created August 12, 2013 18:08
Rounded Corner Image Transformation for square's Picasso
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Shader;
// enables hardware accelerated rounded corners
// original idea here : http://www.curious-creature.org/2012/12/11/android-recipe-1-image-with-rounded-corners/
@pboos
pboos / MainActivity.java
Last active January 29, 2020 17:00
Sample code for ViewPager + PagerTabStrip.
package ch.pboos.android.sample.viewpager;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;