Skip to content

Instantly share code, notes, and snippets.

View gsanthosh91's full-sized avatar

Santhosh gsanthosh91

  • Chennai, India
View GitHub Profile
@gsanthosh91
gsanthosh91 / SATextField.swift
Created April 16, 2019 17:51
iOS UITextField with corner radius
import Foundation
import UIKit
class SATextField: UITextField {
override init(frame: CGRect) {
super.init(frame: frame)
setUpField()
}
@gsanthosh91
gsanthosh91 / SAButton.swift
Created April 16, 2019 17:50
iOS button with corner radious
import Foundation
import UIKit
class SAButton: UIButton {
override init(frame: CGRect) {
super.init(frame: frame)
setupButton()
}
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
public class RecyclerTouchListener implements RecyclerView.OnItemTouchListener {
private GestureDetector gestureDetector;
@gsanthosh91
gsanthosh91 / DisplayableTime.java
Created October 16, 2018 10:01
WhastApp like displayable time
private String getDisplayableTime(long value) {
SimpleDateFormat formatter = new SimpleDateFormat("hh:mm a", Locale.getDefault());
Long mDate = System.currentTimeMillis();
if (mDate > value) {
long difference = mDate - value;
final long seconds = difference / 1000;
final long minutes = seconds / 60;
final long hours = minutes / 60;
final long days = hours / 24;
final long months = days / 31;
@gsanthosh91
gsanthosh91 / ListViewAdapter.kt
Last active June 20, 2018 10:25
Android Live Template for Listview BaseAdapter in Kotlin
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.BaseAdapter
import android.widget.TextView
class ${NAME}(context: Context, list: List<${LIST_MODEL}>) : BaseAdapter() {
@gsanthosh91
gsanthosh91 / RecyclerAdapter.kt
Created June 18, 2018 05:41
Live template for Recyclerview Adapter in Kotlin
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
class ${NAME}(private val list: List<${LIST_MODEL}>) : RecyclerView.Adapter<${NAME}.CustomViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CustomViewHolder {
@gsanthosh91
gsanthosh91 / RecyclerAdapter.kt
Created June 18, 2018 05:41
Live template for Recyclerview Adapter in Kotlin
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
class ${NAME}(private val list: List<${LIST_MODEL}>) : RecyclerView.Adapter<${NAME}.CustomViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CustomViewHolder {