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
@RowlandOti
RowlandOti / MainActivity.java
Created July 16, 2015 17:19
An example pf how to create twitter-like custom menu overflow listview using ListPopupWindow
package com.rowland.magent;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.support.v7.widget.ListPopupWindow;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
@RowlandOti
RowlandOti / gradle-android-signing.gradle
Last active December 1, 2015 17:01
Automated Signing of *.*.apk file in Android Studio
def Properties props = new Properties()
def propFile = file('../signing.properties')
if (propFile.canRead()){
props.load(new FileInputStream(propFile))
if (props!=null && props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
println 'RELEASE BUILD SIGNING'
@RowlandOti
RowlandOti / RecyclerViewCursorAdapter.java
Created December 21, 2015 13:15
An example of using a CursorAdapter with RecyclerView. PATCH: Because RecyclerView.Adapter in its current form doesn't natively support cursors, we "wrap" a CursorAdapter that will do all the job for us
/*
* Copyright 2015 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
package com.fenchtose.footerloaderadapterdemo.adapters;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.fenchtose.footerloaderadapterdemo.R;
<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
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);
@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
@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 / 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 / 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.