Simple Horizontal Divider Item Decoration for RecyclerView
mRecyclerView.addItemDecoration(new SimpleDividerItemDecoration(
getApplicationContext()
));
NOTE: Add item decoration prior to setting the adapter
Below are the Big O performance of common functions of different Java Collections. | |
List | Add | Remove | Get | Contains | Next | Data Structure | |
---------------------|------|--------|------|----------|------|--------------- | |
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array | |
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List | |
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array |
import android.text.TextUtils; | |
import org.junit.Before; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.mockito.invocation.InvocationOnMock; | |
import org.mockito.stubbing.Answer; | |
import org.powermock.core.classloader.annotations.PrepareForTest; | |
import org.powermock.modules.junit4.PowerMockRunner; |
#!/bin/sh | |
set -e | |
if [ -z "$1" ]; then | |
shot_path=$(date +%Y-%m-%d-%H-%M-%S).mp4 | |
else | |
shot_path="$*" | |
fi |
package patterns | |
interface CarService { | |
fun doService() | |
} | |
interface CarServiceDecorator : CarService | |
class BasicCarService : CarService { | |
override fun doService() = println("Doing basic checkup ... DONE") |
package com.frostrocket.samples | |
import android.content.SharedPreferences | |
import androidx.core.content.edit | |
import androidx.preference.PreferenceManager | |
import kotlin.properties.ReadWriteProperty | |
import kotlin.reflect.KProperty | |
/** | |
* Yet another implementation of Shared Preferences using Delegated Properties |
defaults write com.apple.Dock appswitcher-all-displays -bool true | |
killall Dock |