Skip to content

Instantly share code, notes, and snippets.

View iAviatorJose's full-sized avatar

Jose Varghese iAviatorJose

  • Capgemini Technology Services India Limited
  • Mumbai,India
View GitHub Profile
@iAviatorJose
iAviatorJose / RoundedSection.swift
Last active July 20, 2022 03:25
Create Rounded Sections in UITableView
func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
if (cell.respondsToSelector(Selector("tintColor"))){
if (tableView == self.tvUserDetails) {
let cornerRadius : CGFloat = 12.0
cell.backgroundColor = UIColor.clearColor()
let layer: CAShapeLayer = CAShapeLayer()
let pathRef:CGMutablePathRef = CGPathCreateMutable()
let bounds: CGRect = CGRectInset(cell.bounds, 5, 0)
var addLine: Bool = false
@iAviatorJose
iAviatorJose / ClickToSelectEditText.java
Created July 18, 2016 11:51 — forked from rodrigohenriques/ClickToSelectEditText.java
Used to make your EditText a better option than Spinners
public class ClickToSelectEditText<T extends Listable> extends EditText {
List<T> mItems;
String[] mListableItems;
CharSequence mHint;
OnItemSelectedListener<T> onItemSelectedListener;
public ClickToSelectEditText(Context context) {
super(context);
@iAviatorJose
iAviatorJose / CheckState.txt
Created June 30, 2016 12:17
Check Storage State
public static void checkState(File file){
String state = "";
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
state = Environment.getExternalStorageState(file);
} else if((Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP) && (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)) {
Environment.getStorageState(file);
} else if(Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT){
state = Environment.getExternalStorageState();
}
Log.d(TAG,file.getAbsolutePath() + " STATE :" + state);
public void transformPage(View view, float position) {
int pageWidth = view.getWidth();
if (position < -1) { // [-Infinity,-1)
// This page is way off-screen to the left.
view.setAlpha(0);
} else if (position <= 1) { // [-1,1]
public class ParallaxPageTransformer implements ViewPager.PageTransformer {
public void transformPage(View view, float position) {
int pageWidth = view.getWidth();
if (position < -1) { // [-Infinity,-1)
// This page is way off-screen to the left.
view.setAlpha(1);