Skip to content

Instantly share code, notes, and snippets.

View RowlandOti's full-sized avatar
🎯
Focusing on what holds things in their inmost folds.

Rowland Oti RowlandOti

🎯
Focusing on what holds things in their inmost folds.
View GitHub Profile
package com.example.android.booklisting;
import android.app.Activity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
package com.example.android.booklisting;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
@RowlandOti
RowlandOti / EmptyRecyclerView.java
Created July 13, 2016 00:59 — forked from AnirudhaAgashe/EmptyRecyclerView.java
RecyclerView with provosion to add empty view like list view. Displayed when the data set is empty
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
public class EmptyRecyclerView extends RecyclerView {
@RowlandOti
RowlandOti / global.php
Last active April 15, 2018 10:12
Laravel 4.2 Example of how to log errors and exceptions
<?php
/*
|--------------------------------------------------------------------------
| Register The Laravel Class Loader
|--------------------------------------------------------------------------
|
| In addition to using Composer, you may use the Laravel class loader to
| load your controllers and models. This is useful for keeping all of
| your classes in the "global" namespace without Composer updating.
@RowlandOti
RowlandOti / The Technical Interview Cheat Sheet.md
Created March 6, 2016 20:55 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@RowlandOti
RowlandOti / RecyclerViewEmptySupport.java
Created February 1, 2016 15:26
Solution of RecyclerView with setEmptyView method
public class RecyclerViewEmptySupport extends RecyclerView {
private View emptyView;
private AdapterDataObserver emptyObserver = new AdapterDataObserver() {
@Override
public void onChanged() {
Adapter<?> adapter = getAdapter();
if(adapter != null && emptyView != null) {
@RowlandOti
RowlandOti / WrappingLinearLayoutManager.java
Created January 27, 2016 06:14
How to use RecyclerView inside NestedScrollView? Problem can be solved by using a custom layout manager.
/*
* Copyright 2016 Oti Rowland
*
* 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
@RowlandOti
RowlandOti / WrappedGridLayoutManager.java
Last active January 18, 2016 12:06
How to use RecyclerView inside NestedScrollView? Problem can be solved by using a custom layout manager. see http://newtips.co/st/questions/34172307/gridlayoutmanager-on-a-wrapped-layout-does-not-size-up-the-recyclerview-to-displ.html
/*
* Copyright 2016 Oti Rowland
*
* 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
public class MovieFragemnt {
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
// Create new instance of layout manager
final StaggeredGridLayoutManager mStaggeredLayoutManger = new StaggeredGridLayoutManager(getNumberOfColumns(), StaggeredGridLayoutManager.VERTICAL);
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_content"
tools:context=".ContactsActivity">
<android.support.design.widget.AppBarLayout