Skip to content

Instantly share code, notes, and snippets.

View muratcanbur's full-sized avatar

Murat Can BUR muratcanbur

View GitHub Profile
muratcanbur / BaseMockitoTest.kt
Last active April 15, 2019 10:50 — forked from ufuk/
Performs "verify no more interactions" check automatically for all mock objects (works with Mockito version 2). For detailed description: (Turkish)
abstract class BaseMockitoTest {
private val mockitoMocksCollector = MockitoMocksCollector()
fun after() {
val allMocks = mockitoMocksCollector.getAllMocks()
allMocks.forEach { mock ->

Make your multiple type view adapter with annotations!

Gist for Making a Multiple View Types Adapter With Annotations

Pretty easy to use.

  1. Create your delegate adapters, implementing DelegateAdapter, and with the annotation DelegateAdapterType. e.g:
@DelegateAdapterType(itemType = 0)
muratcanbur /
Created April 26, 2017 06:45 — forked from kaushikgopal/
Notes on opportune moments to do "stuff" in the Android Lifecycle
  • In general you want to try and put things in onStart and onStop for logical start and stops.



  • Dagger inject self into graph
  • setContentView(
  • Butterknife.bind(this)
  • RxJava CompositeSubscription.add (if NON UI related work being done)
  • realm = Realm.getDefaultInstance();
muratcanbur /
Last active July 24, 2017 06:42
DolapSubscriber is a base Rx Subscriber class that handles all API requests.
public abstract class DolapSubscriber<T> extends Subscriber<T> {
private MVPView mvpView;
public DolapSubscriber(MVPView mvpView) {
this.mvpView = mvpView;
public void onCompleted() {
muratcanbur /
Created November 10, 2016 18:58
Gradle Config Fields
buildTypes {
debug {
buildConfigField “String”, “BASE_URL”, “\”\""
release {
buildConfigField “String”, “BASE_URL”,“\”\""
muratcanbur / Proguard config
Created November 8, 2016 12:28 — forked from PaNaVTEC/Proguard config
Proguard config
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/panavtec/Documents/android-sdk-macosx/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in
# For more details, see
# Add any project specific keep options here:
muratcanbur /
Last active November 7, 2019 00:02
a background service that handles incoming FCM messages.
package co.mobiwise.firebasetraining.service;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
muratcanbur /
Created October 19, 2015 12:54
public class RadioListFragment extends Fragment implements RadioListView, SwipeRefreshLayout.OnRefreshListener {
RadioListPresenter radioListPresenter;
public RadioListFragment() {
public static RadioListFragment newInstance() {
RadioListFragment fragment = new RadioListFragment();
muratcanbur /
Created September 3, 2015 06:23
Creating RestInterface Class
public final class BaseService {
private BaseService() {
private static Builder getBuilder() {
OkHttpClient client = new OkHttpClient();