Skip to content

Instantly share code, notes, and snippets.

View boy12hoody's full-sized avatar
🎯
Focusing

Boy Hoody boy12hoody

🎯
Focusing
  • Uzbekistan, Tashkent
View GitHub Profile
@fvilarino
fvilarino / ticker_final.kt
Last active February 9, 2024 16:04
Ticker Final
private val TickerCycleMillis = 150
private object AlphabetMapper {
private val Alphabet = " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789•".toList()
val size: Int = Alphabet.size
fun getLetterAt(index: Int): Char = Alphabet[index % size]
fun getIndexOf(letter: Char, offset: Int = 0): TickerIndex {
import androidx.compose.animation.*
import androidx.compose.foundation.gestures.FlingBehavior
import androidx.compose.foundation.gestures.ScrollableDefaults
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.lazy.*
import androidx.compose.runtime.*
@alexzaitsev
alexzaitsev / DefaultLinkMovementMethod.java
Last active January 17, 2024 08:45
How to display HTML using Android Compose
/**
* Set this on a textview and then you can potentially open links locally if applicable
*/
public class DefaultLinkMovementMethod extends LinkMovementMethod {
private OnLinkClickedListener mOnLinkClickedListener;
public DefaultLinkMovementMethod(OnLinkClickedListener onLinkClickedListener) {
mOnLinkClickedListener = onLinkClickedListener;
}
1. hiltvm (applicable in top-level)
@dagger.hilt.android.lifecycle.HiltViewModel
class $NAME$ @javax.inject.Inject constructor(
$PARAM$
) : androidx.lifecycle.ViewModel() {
$END$
}
2. vmstatefunc (applicable in class)
private val _$NAME$ = androidx.compose.runtime.mutableStateOf<$TYPE$>($INITIAL_VALUE$)
@1gravity
1gravity / bitbucket-pipelines.yml
Last active September 8, 2023 09:44
Sample bitbucket pipeline for Android
image: androidsdk/android-30
pipelines:
branches:
master:
- step:
name: Create keystore and API key
script:
# create the keystore file and the google play api key file
- mkdir keys
@Veeyikpong
Veeyikpong / MiddleDividerItemDecoration.kt
Last active July 15, 2023 11:54
MiddleDividerItemDecoration, suitable for both LinearLayoutManager and GridLayoutManager.
/*
* Copyright 2018 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
@ArthurNagy
ArthurNagy / RoundedBottomSheetDialogFragment.kt
Last active May 10, 2024 09:22
Rounded modal bottom sheet as seen in new Google products(Tasks, News, etc.), described in this article: https://medium.com/halcyon-mobile/implementing-googles-refreshed-modal-bottom-sheet-4e76cb5de65b
package com.your.package
import android.app.Dialog
import android.os.Bundle
import com.your.package.R
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
/**
* BottomSheetDialog fragment that uses a custom
@tzmartin
tzmartin / embedded-file-viewer.md
Last active June 10, 2024 10:28
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links