Skip to content

Instantly share code, notes, and snippets.

Richard Le Mesurier mobiRic

Block or report user

Report or block mobiRic

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
@mobiRic
mobiRic / CrashLog.java
Created Sep 5, 2018
Basic wrapper for Crashlytics
View CrashLog.java
package mobi.glowworm.lib.utils.debug;
import android.content.Context;
import android.support.annotation.NonNull;
import com.crashlytics.android.Crashlytics;
import io.fabric.sdk.android.Fabric;
/**
@mobiRic
mobiRic / Composition
Last active Jun 15, 2018
Some thoughts and sample code I have put together to try and explain concepts during the Google Africa ALC v2.0 Udacity course.
View Composition
Here's the followup, which is called *composition*. This pattern is favoured in React Native and Flutter, and seems to be gaining popularity. Instead of extending from one class, we wrap one class in another. Some people say it is much better - I leave that up to the team to read up on.
Here I'm going to have an immutable `message` in some `HandWriting`. Anyone can look at the message by calling `HandWriting.readMe()` which is my fun example of a "getter" type method. We could rename it to `getMessage()` if you really want.
I also have a `Letter` that I'm writing to a friend.
It doesn't really make sense to `extend HandWriting` because a letter is a slightly different concept to the writing inside it.
But the `Letter` does contain some writing. Also has a friend's name that we are sending it to.
Of course, to say that you are reading the Letter, also means you are reading the HandWriting on the letter, right? So the "getter" on the Letter should call into the getter on the HandWriting.
@mobiRic
mobiRic / SimpleTextWatcher
Last active Jun 1, 2018
A simple concrete implementation of the TextWatcher interface that provides no-op implementations of required methods.
View SimpleTextWatcher
/*
* Copyright (C) 2018 Glowworm Software
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
View A Collection of Gradle tricks
This is a collection of gradle tricks for the app's 'build.gradle' file.
@mobiRic
mobiRic / CircleImageView.java
Created Jan 29, 2018
Yet another circle ImageView for Android
View CircleImageView.java
/*
* Copyright (C) 2018 Glowworm Software
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
@mobiRic
mobiRic / DelayFilter.java
Created Oct 5, 2016
This is a direct copy of the {@link android.widget.Filter} class from API 23, with the hidden delay functionality made available.
View DelayFilter.java
/*
* Copyright (C) 2007 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@mobiRic
mobiRic / DummyContent.java
Last active Sep 16, 2016
Timeline Adapter
View DummyContent.java
package mobi.glowworm.demo.timeline.dummy;
import android.support.annotation.Nullable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import mobi.glowworm.demo.timeline.TimelineItem;
@mobiRic
mobiRic / DividerItemDecoration.java
Created Mar 14, 2016 — forked from zokipirlo/DividerItemDecoration.java
DividerItemDecoration. RecyclerView.ItemDecoration simple implementation
View DividerItemDecoration.java
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
@mobiRic
mobiRic / MyCrypto.java
Last active Oct 12, 2015 — forked from upsuper/LICENSE
A Java implementation of SHA-224 message digest algorithm with Provider
View MyCrypto.java
/*
* Copyright (c) 2012 Xidorn Quan
* <p/>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p/>
@mobiRic
mobiRic / EmptyRecyclerView.java
Last active Apr 18, 2019 — forked from henningta/EmptyRecyclerView.java
RecyclerView doesn't have an emptyView support, we gotta fix that
View EmptyRecyclerView.java
/*
* Copyright (C) 2015 Glowworm Software
* Copyright (C) 2014 Nizamutdinov Adel
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
You can’t perform that action at this time.