This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# your package name | |
import android.Manifest | |
import android.content.Context | |
import android.content.Intent | |
import android.content.pm.PackageManager | |
import android.net.Uri | |
import android.os.Build | |
import android.provider.Settings | |
import android.util.Log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// No Security | |
{ | |
"rules": { | |
".read": true, | |
".write": true | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FavMainAdapter constructor( | |
val context: Context?, | |
fragmentManager: FragmentManager | |
) : BaseFragmentPagerAdapter(fragmentManager) { | |
override fun createItem(position: Int): BaseFragment { | |
return when (position) { | |
0 -> MyCollectionsFragment() | |
1 -> MyPlaylistsFragment() | |
else -> throw IndexOutOfBoundsException("IndexOutOfBounds $position") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Rect; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.View; | |
public class ItemDecoration extends RecyclerView.ItemDecoration { | |
/** | |
* | |
* {@link #startPadding} and {@link #endPadding} are final and required on initialization | |
* because {@link android.support.v7.widget.RecyclerView.ItemDecoration} are drawn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* LocationService | |
* La mejor forma de obtener Lat y Long dependiendo el proveedor. | |
* Usando un BroadcastReceiver para la obtención de location | |
* | |
* import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.util.Log; |