Docs cleanup

This commit is contained in:
Aidan Follestad 2018-12-01 01:31:46 -08:00
parent 225434b41a
commit cf802dfa2f
37 changed files with 47 additions and 47 deletions

View file

@ -12,7 +12,7 @@ import android.os.Bundle
typealias ActivityLifeChange = (activity: Activity, resumed: Boolean) -> Unit
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
fun Application.onActivityLifeChange(cb: ActivityLifeChange) {
registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks {
override fun onActivitySaveInstanceState(

View file

@ -20,7 +20,7 @@ import com.afollestad.nocknock.utilities.ext.systemService
import okhttp3.OkHttpClient
import javax.inject.Inject
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
class NockNockApp : Application(), Injector {
companion object {

View file

@ -21,7 +21,7 @@ import kotlinx.android.synthetic.main.list_item_server.view.textUrl
typealias Listener = (model: ServerModel, longClick: Boolean) -> Unit
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
class ServerVH constructor(
itemView: View,
private val adapter: ServerAdapter
@ -62,7 +62,7 @@ class ServerVH constructor(
}
}
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
class ServerAdapter(private val listener: Listener) : RecyclerView.Adapter<ServerVH>() {
private val models = mutableListOf<ServerModel>()

View file

@ -22,7 +22,7 @@ import dagger.Component
import okhttp3.OkHttpClient
import javax.inject.Singleton
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
@Singleton
@Component(
modules = [

View file

@ -13,7 +13,7 @@ import dagger.Binds
import dagger.Module
import javax.inject.Singleton
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
@Module
abstract class MainBindModule {

View file

@ -11,7 +11,7 @@ import dagger.Module
import dagger.Provides
import javax.inject.Singleton
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
@Module
open class MainModule {

View file

@ -12,7 +12,7 @@ import androidx.fragment.app.DialogFragment
import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.nocknock.R
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
class AboutDialog : DialogFragment() {
companion object {
private const val TAG = "[ABOUT_DIALOG]"

View file

@ -52,7 +52,7 @@ private const val KEY_FAB_X = "fab_x"
private const val KEY_FAB_Y = "fab_y"
private const val KEY_FAB_SIZE = "fab_size"
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
fun MainActivity.intentToAdd(
x: Float,
y: Float,
@ -64,7 +64,7 @@ fun MainActivity.intentToAdd(
addFlags(FLAG_ACTIVITY_NO_ANIMATION)
}
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
class AddSiteActivity : AppCompatActivity(), AddSiteView {
companion object {

View file

@ -21,7 +21,7 @@ import kotlinx.coroutines.launch
import okhttp3.HttpUrl
import javax.inject.Inject
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
data class InputErrors(
var name: Int? = null,
var url: Int? = null,
@ -35,7 +35,7 @@ data class InputErrors(
}
}
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
interface AddSitePresenter {
fun takeView(view: AddSiteView)
@ -58,7 +58,7 @@ interface AddSitePresenter {
fun dropView()
}
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
class RealAddSitePresenter @Inject constructor(
private val serverModelStore: ServerModelStore,
private val checkStatusManager: CheckStatusManager

View file

@ -9,7 +9,7 @@ import androidx.annotation.StringRes
import com.afollestad.nocknock.utilities.ext.ScopeReceiver
import kotlin.coroutines.CoroutineContext
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
interface AddSiteView {
fun setLoading()

View file

@ -41,7 +41,7 @@ import kotlinx.android.synthetic.main.include_empty_view.emptyText
import javax.inject.Inject
import kotlin.coroutines.CoroutineContext
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
class MainActivity : AppCompatActivity(), MainView {
companion object {

View file

@ -18,7 +18,7 @@ import kotlinx.coroutines.async
import kotlinx.coroutines.launch
import javax.inject.Inject
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
interface MainPresenter {
fun takeView(view: MainView)
@ -34,7 +34,7 @@ interface MainPresenter {
fun dropView()
}
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
class RealMainPresenter @Inject constructor(
private val serverModelStore: ServerModelStore,
private val notificationManager: NockNotificationManager,

View file

@ -9,7 +9,7 @@ import com.afollestad.nocknock.data.ServerModel
import com.afollestad.nocknock.utilities.ext.ScopeReceiver
import kotlin.coroutines.CoroutineContext
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
interface MainView {
fun setModels(models: List<ServerModel>)

View file

@ -80,13 +80,13 @@ import javax.inject.Inject
private const val KEY_VIEW_MODEL = "site_model"
/** @author Aidan Follestad (afViewSiteActivityollestad) */
/** @author Aidan Follestad (@afollestad) */
fun MainActivity.intentToView(model: ServerModel) =
Intent(this, ViewSiteActivity::class.java).apply {
putExtra(KEY_VIEW_MODEL, model)
}
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
class ViewSiteActivity : AppCompatActivity(),
View.OnClickListener,
Toolbar.OnMenuItemClickListener {

View file

@ -16,7 +16,7 @@ import kotlin.math.max
const val CHECK_INTERVAL_UNSET = -1L
const val LAST_CHECK_NONE = -1L
/** @author Aidan Follestad (afollestad)*/
/** @author Aidan Follestad (@afollestad)*/
data class ServerModel(
var id: Int = 0,
val name: String,

View file

@ -9,7 +9,7 @@ import com.afollestad.nocknock.data.ServerStatus.CHECKING
import com.afollestad.nocknock.data.ServerStatus.OK
import com.afollestad.nocknock.data.ServerStatus.WAITING
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
enum class ServerStatus(val value: Int) {
OK(1),
WAITING(2),

View file

@ -5,7 +5,7 @@
*/
package com.afollestad.nocknock.data
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
enum class ValidationMode(val value: Int) {
STATUS_CODE(1),
TERM_SEARCH(2),

View file

@ -13,7 +13,7 @@ import dagger.Binds
import dagger.Module
import javax.inject.Singleton
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
@Module
abstract class EngineModule {

View file

@ -25,7 +25,7 @@ private const val SQL_CREATE_ENTRIES =
private const val SQL_DELETE_ENTRIES = "DROP TABLE IF EXISTS ${ServerModel.TABLE_NAME}"
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
class ServerModelDbHelper(context: Context) : SQLiteOpenHelper(
context, DATABASE_NAME, null, DATABASE_VERSION
) {

View file

@ -14,7 +14,7 @@ import com.afollestad.nocknock.data.ServerModel.Companion.TABLE_NAME
import com.afollestad.nocknock.utilities.ext.diffFrom
import javax.inject.Inject
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
interface ServerModelStore {
suspend fun get(id: Int? = null): List<ServerModel>
@ -30,7 +30,7 @@ interface ServerModelStore {
suspend fun deleteAll(): Int
}
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
class RealServerModelStore @Inject constructor(
app: Application
) : ServerModelStore {

View file

@ -19,7 +19,7 @@ import kotlinx.coroutines.async
import kotlinx.coroutines.launch
import javax.inject.Inject
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
class BootReceiver : BroadcastReceiver() {
companion object {

View file

@ -33,7 +33,7 @@ import kotlinx.coroutines.withContext
import java.lang.System.currentTimeMillis
import javax.inject.Inject
/** @author Aidan Follestad (afollestad)*/
/** @author Aidan Follestad (@afollestad)*/
class CheckStatusJob : JobService() {
companion object {

View file

@ -25,13 +25,13 @@ import okhttp3.Response
import java.net.SocketTimeoutException
import javax.inject.Inject
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
data class CheckResult(
val model: ServerModel,
val response: Response? = null
)
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
interface CheckStatusManager {
suspend fun ensureScheduledChecks()

View file

@ -11,7 +11,7 @@ import android.os.Build.VERSION_CODES
import androidx.annotation.RequiresApi
import androidx.core.app.NotificationManagerCompat.IMPORTANCE_DEFAULT
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
enum class Channel(
val id: String,
val title: Int,
@ -26,7 +26,7 @@ enum class Channel(
)
}
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
@RequiresApi(VERSION_CODES.O)
fun Channel.toNotificationChannel(context: Context): NotificationChannel {
val titleText = context.getString(this.title)

View file

@ -37,7 +37,7 @@ interface NockNotificationManager {
fun cancelStatusNotifications()
}
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
class RealNockNotificationManager @Inject constructor(
private val app: Application,
@AppIconRes private val appIconRes: Int,

View file

@ -12,7 +12,7 @@ import androidx.core.app.NotificationCompat
typealias NotificationBuilder = NotificationCompat.Builder
typealias NotificationConstructor = NotificationBuilder.() -> Unit
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
fun notification(
context: Context,
channel: Channel,

View file

@ -9,7 +9,7 @@ import dagger.Binds
import dagger.Module
import javax.inject.Singleton
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
@Module
abstract class NotificationsModule {

View file

@ -5,7 +5,7 @@
*/
package com.afollestad.nocknock.utilities
/** @author Aidan Follestad (afollestad)*/
/** @author Aidan Follestad (@afollestad)*/
interface Injector {
fun injectInto(target: Any)

View file

@ -13,7 +13,7 @@ import dagger.Binds
import dagger.Module
import javax.inject.Singleton
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
@Module
abstract class UtilitiesModule {

View file

@ -7,7 +7,7 @@ package com.afollestad.nocknock.utilities.ext
import android.content.Context
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
inline fun <reified T> Context.systemService(name: String): T {
return getSystemService(name) as T
}

View file

@ -11,7 +11,7 @@ import org.mozilla.javascript.Context
import org.mozilla.javascript.EvaluatorException
import org.mozilla.javascript.Function
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
object JavaScript {
fun eval(

View file

@ -11,13 +11,13 @@ import android.graphics.BitmapFactory.decodeResource
import androidx.annotation.DrawableRes
import javax.inject.Inject
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
interface BitmapProvider {
fun get(@DrawableRes res: Int): Bitmap
}
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
class RealBitmapProvider @Inject constructor(
private val app: Application
) : BitmapProvider {

View file

@ -15,7 +15,7 @@ interface StringProvider {
fun get(@StringRes res: Int): String
}
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
class RealStringProvider @Inject constructor(
private val app: Application
) : StringProvider {

View file

@ -8,7 +8,7 @@ package com.afollestad.nocknock.utilities.qualifiers
import javax.inject.Qualifier
import kotlin.annotation.AnnotationRetention.RUNTIME
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
@Qualifier
@Retention(RUNTIME)
annotation class AppIconRes

View file

@ -20,7 +20,7 @@ import kotlinx.android.synthetic.main.check_interval_layout.view.input
import kotlinx.android.synthetic.main.check_interval_layout.view.spinner
import kotlin.math.ceil
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
class CheckIntervalLayout(
context: Context,
attrs: AttributeSet? = null

View file

@ -16,7 +16,7 @@ import com.afollestad.nocknock.viewcomponents.ext.trimmedText
import kotlinx.android.synthetic.main.javascript_input_layout.view.error_text
import kotlinx.android.synthetic.main.javascript_input_layout.view.userInput
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
class JavaScriptInputLayout(
context: Context,
attrs: AttributeSet? = null

View file

@ -14,7 +14,7 @@ import com.afollestad.nocknock.data.ServerStatus.ERROR
import com.afollestad.nocknock.data.ServerStatus.OK
import com.afollestad.nocknock.data.ServerStatus.WAITING
/** @author Aidan Follestad (afollestad) */
/** @author Aidan Follestad (@afollestad) */
class StatusImageView(
context: Context,
attrs: AttributeSet? = null