Skip to content

Instantly share code, notes, and snippets.

John johncodeos

Block or report user

Report or block johncodeos

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Constant.kt
class Constant {
class MoPub {
companion object {
val BANNER_AD_UNIT = "b195f8dd8ded45fe847ad89ed1d016da"
"This app presonalizes your advertising experience " +
"through MoPub, a division of Twitter International " +
"company. By consenting to this enhanced ad " +
View AdFragment.kt
class AdFragment: Fragment() {
lateinit var mAdPlacer: MoPubStreamAdPlacer
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val position = arguments!!.getInt(ARG_AD_POSITION)
mAdPlacer.placeAdsInRange(position - 5, position + 5)
return mAdPlacer.getAdView(position, null, container)
View Constant.kt
object Constant {
const val VIEW_TYPE_ITEM = 0
const val VIEW_TYPE_LOADING = 1
View Podfile
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'LibrariesLicensesExample' do
# Comment the next line if you don't want to use dynamic frameworks
pod 'Alamofire'
pod 'FLAnimatedImage'
pod 'SDWebImage'
View styles(v21).xml
<resources xmlns:tools="">
<style name="CustomProgressBarTheme">
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowLightStatusBar" tools:targetApi="m">false</item>
<item name="android:windowBackground">@android:color/transparent</item>
View CustomProgressBar.kt
class CustomProgressBar {
lateinit var dialog: Dialog
fun show(context: Context): Dialog {
return show(context, null)
fun show(context: Context, title:CharSequence?): Dialog {
val inflator = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
View Communicator.kt
interface Communicator {
fun passDataCom(editext_input: String)
View Fragment1.kt
class Fragment1: Fragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val rootView = inflater.inflate(R.layout.fragment_1, container, false)
return rootView
View build.gradle
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
View AndroidYoutubePlayerActivity.kt
class AndroidYoutubePlayerActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
third_party_player_view.addYouTubePlayerListener(object : AbstractYouTubePlayerListener() {
override fun onReady(@NonNull youTubePlayer: YouTubePlayer) {
val videoId = "YE7VzlLtp-4"
You can’t perform that action at this time.