This file contains 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.util.Log | |
object Logs { | |
var isLoggingEnabled = false | |
private const val TAG = "Logs" | |
private const val PREFIX = ">>>PREFIX:" | |
fun verboseln(message: () -> String) { | |
if (isLoggingEnabled) { |
This file contains 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
override fun summaryViewModelOf(viewModels: List<ContactEventNotificationViewModel>): SummaryNotificationViewModel { | |
val title = NaturalLanguageUtils.joinContacts(strings, contacts, MAX_CONTACTS) | |
val label = strings.dontForgetToSendWishes() | |
val lines = arrayListOf<CharSequence>() | |
viewModels.forEach { contactViewModel -> | |
val boldedTitle = SpannableString("${contactViewModel.title}\t\t${contactViewModel.label}").apply { | |
setSpan(StyleSpan(Typeface.BOLD), 0, contactViewModel.title.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) | |
} |
This file contains 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
private fun notifyContacts(viewModels: List<ContactEventNotificationViewModel>) { | |
viewModels.forEach { viewModel -> | |
val requestCode = NotificationConstants.CHANNEL_ID_CONTACTS.hashCode() + viewModel.hashCode() | |
val startIntent = PersonActivity.buildIntentFor(context, viewModel.contact) | |
val pendingIntent = PendingIntent.getActivity( | |
context, | |
requestCode, | |
startIntent, | |
PendingIntent.FLAG_UPDATE_CURRENT) |
This file contains 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
private fun notifyContacts(viewModels: List<ContactEventNotificationViewModel>) { | |
viewModels.forEach { viewModel -> | |
val requestCode = NotificationConstants.CHANNEL_ID_CONTACTS.hashCode() + viewModel.hashCode() | |
val startIntent = PersonActivity.buildIntentFor(context, viewModel.contact) | |
val pendingIntent = PendingIntent.getActivity( | |
context, | |
requestCode, | |
startIntent, | |
PendingIntent.FLAG_UPDATE_CURRENT) |
This file contains 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 RadiusTransition private constructor(private val startingRadius: Float, private val endingRadius: Float) : Transition() { | |
override fun captureStartValues(transitionValues: TransitionValues) { | |
if (transitionValues.view is ImageView) { | |
transitionValues.values[PROPNAME_RADIUS] = startingRadius | |
} | |
} | |
override fun captureEndValues(transitionValues: TransitionValues) { | |
if (transitionValues.view is ImageView) { |
This file contains 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
package com.alexstyl.myapplication; | |
import android.content.res.Resources; | |
import android.support.annotation.StringRes; | |
class AndroidStringResources implements StringResources { | |
private final Resources resources; | |
AndroidStringResources(Resources resources) { |
This file contains 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
#include <SPI.h> | |
#include <WiFi.h> | |
char ssid[] = "---"; // your network SSID (name) | |
char pass[] = "---"; // your network password | |
char server[] = "www.google.com"; | |
//IPAddress server(64,131,82,241); | |
int keyIndex = 0; // your network key Index number (needed only for WEP) |
NewerOlder