Skip to content

Instantly share code, notes, and snippets.

🚀
Building Coinverse's Android app

AdamHurwitz AdamSHurwitz

🚀
Building Coinverse's Android app
Block or report user

Report or block AdamSHurwitz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
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 / 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(
@AdamSHurwitz
AdamSHurwitz / RippleTextView.java
Created Aug 23, 2017
RippleTextView.java with RippleEffect.addRippleEffect() method
View RippleTextView.java
public RippleTextView(Context context) {
super(context);
getXMLAttributes(context, null);
RippleEffect.addRippleEffect(this, rippleEnabled,
backgroundColor, rippleColor);
}
public RippleTextView(Context context, AttributeSet attrs) {
super(context, attrs);
getXMLAttributes(context, attrs);
RippleEffect.addRippleEffect(this, rippleEnabled,
@AdamSHurwitz
AdamSHurwitz / DBFlowQuery.kt
Last active Aug 24, 2017
Kotlin DBflow query one attribute
View DBFlowQuery.kt
fun queryMemberStatus(id: String): Observable<List<Group>> {
return Observable.just(
SQLite.select(Group_Table.memberStatus)
.from(Group::class.java)
.where(Group_Table.id.`is`(id)).queryList())
}
You can’t perform that action at this time.