Skip to content

Instantly share code, notes, and snippets.

View mbahgojol's full-sized avatar
👋
Selamat Datang

Ghozi Mahdi mbahgojol

👋
Selamat Datang
View GitHub Profile
@mbahgojol
mbahgojol / App.java
Created April 8, 2017 09:29
class application
public class App extends Application{
private static Context context;
@Override
public void onCreate() {
super.onCreate();
context = getApplicationContext();
}
Sorokin Mbak nila huuuuuuu..
mana orang tuh yang lagi baca... :p
kasian delloo.... :p
@mbahgojol
mbahgojol / ZoomLayout.java
Created December 18, 2017 08:09 — forked from anorth/ZoomLayout.java
Pinch-zoomable Android frame layout
package au.id.alexn;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
import android.widget.FrameLayout;
@mbahgojol
mbahgojol / gist:f658b9bf2bfe4a4e75acc339f9fc3fbf
Created September 20, 2018 03:02
/home/knalb/AndroidStudioProjects/FootballClub/app/src/main/java/com/module/footballclub/MainActivity.kt: (40, 20): Overload resolution ambiguity: public inline fun ViewManager.frameLayout(init: (@AnkoViewDslMarker _FrameLayout).() -> Unit): FrameLayout defined in org.jetbrains.anko public inline fun ViewManager.frameLayout(init: (@AnkoViewDslMa…
package com.module.footballclub
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
import android.view.View
import android.widget.FrameLayout
import android.widget.ListAdapter
import com.module.footballclub.adapter.AdapterFootballClub
// PagingSource
private const val MOVIES_STARTING_PAGE_INDEX = 1
class MoviesPagingSource(
private val apiHelper: ApiHelper
) : RxPagingSource<Int, ResultsItem>() {
override fun loadSingle(params: LoadParams<Int>): Single<LoadResult<Int, ResultsItem>> {
val position = params.key ?: MOVIES_STARTING_PAGE_INDEX
Log.d("POSITION", position.toString())