Skip to content

Instantly share code, notes, and snippets.

View sergenes's full-sized avatar
🏠
Working from home

Sergey Neskoromny sergenes

🏠
Working from home
View GitHub Profile
@sergenes
sergenes / apps.html
Last active October 19, 2018 13:03
My Apps
AirSync
iOS - https://itunes.apple.com/us/app/airsync-for-apple-stickies/id554182458?mt=8
MacOS - https://itunes.apple.com/us/app/airsync-for-apple-stickies/id543513150?mt=12
Android - https://play.google.com/store/apps/details?id=com.umnes.stickies2go
PhotoDj
Web - https://photodj.me
iOS - https://itunes.apple.com/us/app/photodj-zoom-your-photos-in/id1325400635?mt=8
Android - https://play.google.com/store/apps/details?id=com.nes.pdj.photodj
@sergenes
sergenes / PhonecallReceiver.java
Created November 2, 2018 14:52 — forked from ftvs/PhonecallReceiver.java
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {
enum class RowType {
TOP, MIDDLE, BOTTOM, SINGLE
}
@Composable
fun HomeListItem(
title: String,
subTitle: String,
type: RowType,
editMode: Boolean = false,
@sergenes
sergenes / Constants.kt
Last active June 23, 2021 21:07
Constants1
val primaryTextColor = Color(0xFF444444)
val primaryColor = Color(0xffadf4ff)
val normalSpace = 16.dp
val smallSpace = 8.dp
val noSpace = 0.dp
val normalTouchableHeight = 44.dp
val noRadius = 0.dp
val normalRadius = 16.dp
val rowHeight = 84.dp
val shape = when (type) {
RowType.TOP -> {
RoundedCornerShape(normalRadius, normalRadius)
}
RowType.BOTTOM -> {
RoundedCornerShape(
noRadius,
noRadius,
normalRadius,
normalRadius)
Column {
Row(){
...
}
if (type != RowType.BOTTOM && type != RowType.SINGLE) {
Divider(
modifier = Modifier
.padding(normalSpace, noSpace, normalSpace, noSpace),
color = Color.White,
thickness = dividerNormalThickness
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.clickable(onClick = onClick)
.padding(normalSpace, noSpace, normalSpace, noSpace)
.fillMaxWidth()
.height(rowHeight)
.clip(shape)
.background(color = primaryColor)
) {
var deleteMode by remember { mutableStateOf(false) }
if (editMode && !deleteMode) {
Button(
onClick = {
deleteMode = !deleteMode
}, modifier = Modifier
.width(deleteButtonWidth)
.fillMaxHeight(),
shape = RoundedCornerShape(noRadius),
colors = ButtonDefaults.outlinedButtonColors(
Column(Modifier.weight(1f)) {
Column(
horizontalAlignment = Alignment.Start,
modifier = Modifier.padding(normalSpace)
) {
Text(
title,
style = MaterialTheme.typography.subtitle1,
color = secondaryColor,
maxLines = 1,
if (!editMode && !deleteMode) {
Icon(
imageVector = Icons.Filled.ChevronRight,
contentDescription = "forward",
modifier = Modifier.align(Alignment.CenterVertically)
)
Spacer(Modifier.width(normalRadius))
}