Skip to content

Instantly share code, notes, and snippets.

View adam-hurwitz's full-sized avatar

Adam Hurwitz adam-hurwitz

View GitHub Profile
@Table(name = "ModelName", database = DatabaseName::class)
data class Group(@PrimaryKey(autoincrement = false) @Column(name = "id") var id: String = "",
@Column(name = "name") var name: String = "",
var coverPhoto: CoverPhoto? = null,
var emailDomains: Array<String>? = null) : BaseModel() {
}
@adam-hurwitz
adam-hurwitz / build.gradle
Created August 23, 2017 04:17
Bintray dependencies
...
dependencies {
...
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
...
}
...
@adam-hurwitz
adam-hurwitz / build.gradle
Last active February 4, 2020 22:42
Jcenter gradle configuration
ext {
bintrayRepo = 'customrippleview'
bintrayName = 'customrippleview'
publishedGroupId = 'com.ebay.customrippleview'
libraryName = 'CustomRippleView'
artifact = 'customrippleview'
libraryDescription = 'Custom Ripple View for Android'
siteUrl = 'https://github.com/eBay/CustomRippleView'
gitUrl = 'https://github.com/eBay/CustomRippleView.git'
libraryVersion = '1.0'
@adam-hurwitz
adam-hurwitz / recycler_headercell.xml
Last active March 27, 2020 20:01
RippleTextView from library
<com.ebay.customrippleview.RippleTextView
android:id="@+id/course_index"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:gravity="center"
android:paddingBottom="4dp"
android:paddingTop="4dp"
android:text="@string/course_index"
android:textColor="@android:color/white"
@adam-hurwitz
adam-hurwitz / recycler_headercell.xml
Last active August 23, 2017 04:53
RippleTextView from local module
<com.adamhurwitz.retrorecycler.DesignComponents.RippleTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:gravity="center"
android:text="@string/course_index"
android:textColor="@color/colorPrimaryDark"
android:textSize="16sp"
app:backgroundColor="@color/background"
app:rippleColor="@color/ripple" />
@adam-hurwitz
adam-hurwitz / RippleTextView.java
Created August 23, 2017 04:58
RippleTextView constructors
public class RippleTextView extends AppCompatTextView {
public RippleTextView(Context context) {
super(context);
}
public RippleTextView(Context context, AttributeSet attrs) {
super(context, attrs);
}
<resources>
<declare-styleable name="RippleText">
<attr name ="rippleEnabled" format="boolean" />
<attr name = "backgroundColor" format="color" />
<attr name = "rippleColor" format="color" />
</declare-styleable>
</resources>
<resources>
...
<color name="ripple_default">#848485</color>
<color name="background">#02B3E2</color>
<color name="ripple">#2C3B48</color>
...
</resources>
@adam-hurwitz
adam-hurwitz / RippleTextView.java
Created August 23, 2017 05:05
Receive attributes in Custom View At Runtime.
public RippleTextView(Context context) {
super(context);
//Retrieve attribute values at runtime
getXMLAttributes(context, null);
}
public RippleTextView(Context context, AttributeSet attrs) {
super(context, attrs);
//Retrieve attribute values at runtime
getXMLAttributes(context, attrs);
public class RippleEffect {
public static void addRippleEffect(View view, boolean
rippleEnabled, int backgroundColor, int rippleColor) {
if (rippleEnabled && Build.VERSION.SDK_INT >=
Build.VERSION_CODES.LOLLIPOP) {
//Create RippleDrawable
view.setBackground(