Skip to content

Instantly share code, notes, and snippets.

View ckdevrel's full-sized avatar

Chandrasekar Kuppusamy ckdevrel

View GitHub Profile
<merge from="AndroidManifest.xml.ftl" to="${escapeXmlAttribute(manifestOut)}/AndroidManifest.xml" />
<dependency mavenUrl=”com.android.support:recyclerview-v7:${buildApi}.+”/>
<parameter id="features" name="RecyclerView Style" type="enum" default="simple" help="Choose your own RecyclerView style">
<option id="simple">Simple RecyclerView</option>
<option id="banner">Banner RecyclerView</option>
<option id="radio">RadioButton Recyclerview</option>
<option id="checkbox">Checkbox Recyclerview</option>
<option id="toggle">Toggle Recyclerview</option>
<option id="googleplay">GooglePlay like Recyclerview</option>
</parameter>
<parameter id=”isToolbar”
name=”Need Toolbar”
type=”boolean”
default=”false”
visibility=”!isFragment”
help=”If true, this activity will have a Toolbar”/>
if(isFragmentCheckBoxEnabled){
view.setVisibility(View.GONE)
}else{
view.setVisibility(View.VISIBLE)
}
<parameter id=”activityClass”
name=”Activity Name”
type=”string”
constraints=”class|unique|nonempty”
visibility=”!isFragment”
default=”MainActivity”
help=”The name of the activity class to create”/>
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.Locale;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.Duration;
import org.joda.time.Period;
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/white"
android:orientation="vertical">
<LinearLayout
To create a circle dynamically:
public static ShapeDrawable drawCircle (Context context, int width, int height, int color) {
ShapeDrawable oval = new ShapeDrawable (new OvalShape ());
oval.setIntrinsicHeight (height);
oval.setIntrinsicWidth (width);
oval.getPaint ().setColor (color);
oval.setPadding (10,10,10,10);
return oval;
Small Star
mdpi: 16px
hdpi: 24px
xhdpi: 32px
xxhdpi: 48px
Medium Star
mdpi: 24px