sudo apt install aria2 youtube-dl
chmod +x [script_file_name].sh
import android.content.Context | |
import android.net.ConnectivityManager | |
import android.net.NetworkCapabilities | |
import android.os.Build | |
val Context.isConnected: Boolean | |
get() { | |
val connectivityManager = this.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager | |
return when { | |
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M -> { |
class FCMService2 : FirebaseMessagingService() { | |
private var pendingIntent: PendingIntent? = null | |
override fun onMessageReceived(remoteMessage: RemoteMessage?) { | |
Log.e("get_type_data", remoteMessage!!.data.toString()) | |
createNotification(remoteMessage.data) | |
} | |
private fun createNotification(messageBody: Map<String, String>) { |
package com.upmc.enterprises.myupmc | |
import android.support.v7.widget.GridLayoutManager | |
import android.support.v7.widget.LinearLayoutManager | |
import android.support.v7.widget.RecyclerView | |
import android.support.v7.widget.StaggeredGridLayoutManager | |
abstract class EndlessRecyclerViewScrollListener( | |
private val layoutManager: RecyclerView.LayoutManager, | |
private val indexDelta: Int = 20 |
abstract class DiffUtilAdapter<D, VH : RecyclerView.ViewHolder> : RecyclerView.Adapter<VH>(), CoroutineScope { | |
override val coroutineContext = Dispatchers.Main.immediate | |
protected var dataset: List<D> = listOf() | |
private set | |
private val diffCallback by lazy(LazyThreadSafetyMode.NONE) { DiffCallback<D>() } | |
protected val detectMoves = true | |
private val updateActor = actor<List<D>>(capacity = Channel.CONFLATED) { | |
for (list in channel) internalUpdate(list) | |
} |
package example | |
import android.support.v7.recyclerview.extensions.AsyncDifferConfig | |
import android.support.v7.recyclerview.extensions.AsyncListDiffer | |
import android.support.v7.util.DiffUtil | |
import android.support.v7.util.ListUpdateCallback | |
import android.support.v7.widget.RecyclerView | |
/** | |
* {@link RecyclerView.Adapter RecyclerView.Adapter} base class based on |
import android.os.Bundle; | |
import android.support.design.widget.FloatingActionButton; | |
import android.support.design.widget.Snackbar; | |
import android.support.v4.app.FragmentTransaction; | |
import android.support.v4.content.ContextCompat; | |
import android.support.v4.view.MarginLayoutParamsCompat; | |
import android.view.View; | |
import android.support.design.widget.NavigationView; | |
import android.support.v4.view.GravityCompat; | |
import android.support.v4.widget.DrawerLayout; |
<?xml version="1.0" encoding="utf-8"?><!-- | |
~ Copyright (C) 2015 The Android Open Source Project | |
~ | |
~ Licensed under the Apache License, Version 2.0 (the "License"); | |
~ you may not use this file except in compliance with the License. | |
~ You may obtain a copy of the License at | |
~ | |
~ http://www.apache.org/licenses/LICENSE-2.0 | |
~ | |
~ Unless required by applicable law or agreed to in writing, software |