Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Building Coinverse's Android app

AdamHurwitz AdamSHurwitz

🚀
Building Coinverse's Android app
View GitHub Profile
View ModelName.kt
@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() {
}
@AdamSHurwitz
AdamSHurwitz / build.gradle
Created Aug 23, 2017
Bintray dependencies
View build.gradle
...
dependencies {
...
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
...
}
...
@AdamSHurwitz
AdamSHurwitz / build.gradle
Last active Feb 4, 2020
Jcenter gradle configuration
View build.gradle
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'
@AdamSHurwitz
AdamSHurwitz / recycler_headercell.xml
Last active Mar 27, 2020
RippleTextView from library
View recycler_headercell.xml
<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"
@AdamSHurwitz
AdamSHurwitz / recycler_headercell.xml
Last active Aug 23, 2017
RippleTextView from local module
View recycler_headercell.xml
<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" />
@AdamSHurwitz
AdamSHurwitz / RippleTextView.java
Created Aug 23, 2017
RippleTextView constructors
View RippleTextView.java
public class RippleTextView extends AppCompatTextView {
public RippleTextView(Context context) {
super(context);
}
public RippleTextView(Context context, AttributeSet attrs) {
super(context, attrs);
}
View attrs_ripple_text.xml
<resources>
<declare-styleable name="RippleText">
<attr name ="rippleEnabled" format="boolean" />
<attr name = "backgroundColor" format="color" />
<attr name = "rippleColor" format="color" />
</declare-styleable>
</resources>
View color.xml
<resources>
...
<color name="ripple_default">#848485</color>
<color name="background">#02B3E2</color>
<color name="ripple">#2C3B48</color>
...
</resources>
@AdamSHurwitz
AdamSHurwitz / RippleTextView.java
Created Aug 23, 2017
Receive attributes in Custom View At Runtime.
View RippleTextView.java
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);
View RippleEffect.java
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(