Skip to content

Instantly share code, notes, and snippets.

View webserveis's full-sized avatar

Webserveis webserveis

View GitHub Profile
@webserveis
webserveis / MainActivity.java
Last active November 24, 2023 09:06
RecyclerView onClick
package com.example.testlist;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
@webserveis
webserveis / CircularSliderLimit.swift
Created November 2, 2023 10:04
CircularSlider0to100
//
// CircularSlider.swift
// CircularSliderTest
//
// Created by Tarlan Ismayilsoy on 28.08.22.
//
import SwiftUI
// MARK: - CircularSlider
@webserveis
webserveis / trigometry.js
Created October 23, 2023 10:08
Trigometria canvas js
//<canvas><canvas>
function degreeToradians(degrees) {
return degrees * Math.PI / 180;
}
function getPosition(centerX, centerY, radius, endAngle) {
// Calculamos las coordenadas x e y del punto final del arco.
var x = centerX + radius * Math.cos(endAngle);
var y = centerY + radius * Math.sin(endAngle);
@webserveis
webserveis / MainActivity.kt
Last active October 19, 2023 21:36
Implementar click RecyclerView Kotlin AndroidX
val mAdapter = MySimpleAdapter(dummyData())
recycler_view.setHasFixedSize(true)
recycler_view.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
recycler_view.adapter = mAdapter
mAdapter.setOnItemClickListener(object : MySimpleAdapter.ClickListener {
override fun onItemClick(v: View, position: Int) {
Log.v(TAG, "onItemClick ${position}")
@webserveis
webserveis / Get packages android.md
Last active October 5, 2023 14:36
Get all packages user, system.. in Android
@webserveis
webserveis / material text sizes.md
Last active September 20, 2023 10:10 — forked from passsy/material text sizes.md
Material font sizes

Material text sizes XML for Android

Simple helper file for standard text sizes in material design. The sizes are provided by the material design documentation https://www.google.com/design/spec/style/typography.html#typography-roboto

material typography

Standard Styles

Too many type sizes and styles at once can wreck any layout. A typographic scale is a limited set of type sizes that work well together, along with the layout grid. The basic set of styles are based on a typographic scale of 12, 14, 16, 20, and 34.

@webserveis
webserveis / ContentView.swift
Created July 31, 2023 15:43 — forked from dkun7944/ContentView.swift
AirDrop iOS 17 Swift.Shader Animation
//
// ContentView.swift
// Airdrop Demo
//
// Created by Daniel Kuntz on 7/30/23.
//
import SwiftUI
struct ContentView: View {
@webserveis
webserveis / MainActivity.kt
Created February 26, 2020 12:14
Foreground Services en Kotlin
package com.webserveis.testservices
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {
package com.codelaby.mapviewer
import android.annotation.SuppressLint
import android.content.Context
import android.location.Location
import android.os.Looper
import android.util.Log
import androidx.lifecycle.LiveData
import com.google.android.gms.location.*
package com.codelaby.mapviewer
import android.Manifest
import android.content.Context
import android.content.pm.PackageManager
import android.location.Location
import android.location.LocationListener
import android.location.LocationManager
import android.os.Build
import android.os.Bundle