Skip to content

Instantly share code, notes, and snippets.

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

José Geraldo de Lima Júnior JGeraldoLima

🏠
Working from home
View GitHub Profile
@JGeraldoLima
JGeraldoLima / AnyTypeTextField.kt
Created February 8, 2025 02:02
A JetpackCompose component to provide a field that accepts multiple input types
package me.jgeraldo.compose.ui
import androidx.compose.foundation.border
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.foundation.layout.fillMaxWidth
@JGeraldoLima
JGeraldoLima / HyperLinkText.kt
Last active February 8, 2025 01:57
A JetpackCompose component to show pieces of a text as a hyperlink
package me.jgeraldo.compose.ui
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.LinkAnnotation
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.buildAnnotatedString
@JGeraldoLima
JGeraldoLima / .gitlab-ci.yml
Created April 17, 2019 11:26
Android .gitlab-ci.yml Gitlab CI/CD example file
image: openjdk:8-jdk
variables:
ANDROID_COMPILE_SDK: "28"
ANDROID_BUILD_TOOLS: "29.0.0-rc2"
ANDROID_SDK_TOOLS: "26.1.1" # only to register, because since some version, the link to download does not follow a pattern with the desired SDK version
APP_NAME: "MyProject"
before_script:
- apt-get --quiet update --yes
@JGeraldoLima
JGeraldoLima / ionic-full-screen-loading-teplate.scss
Last active September 6, 2018 13:44
An Ionic template to build full screen loading, using native LoadingController
.background {
background-image: url('../../assets/<your_bg>.png');
background-size: cover;
}
.text-loading {
margin: auto;
padding-top: 5rem;
padding-left: 6rem;
padding-right: 6rem;
@JGeraldoLima
JGeraldoLima / webkit-device-pixel-ratio_to_android-density.scss
Last active October 4, 2018 12:28
Map of -webkit-min-device-pixel-ratio/-webkit-max-device-pixel-ratio values to Android/iOS screen density levels. Useful for mobile hybrid (Ionic, ReactNative, NativeScript and so on) frameworks based on web development assets dimensioning.
/* Example of a CSS class to use to show the asset */
/** Ionic example
<ion-grid align="center">
<ion-row justify-content-center>
<ion-col col-8 align-self-baseline>
<div class="camera-icon"></div>
</ion-col>
</ion-row>
</ion-grid>
@JGeraldoLima
JGeraldoLima / CountryPreference.java
Last active March 20, 2018 16:13
Android Country preference using 100% native resources, with no need to read countries from external files. Automatically sorted and translated.
package <your_package>;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.AttributeSet;
/* You can use default ListPreference if you prefer.
Got this lib from <link>https://github.com/afollestad/material-dialogs</link>
*/
import com.afollestad.materialdialogs.prefs.MaterialListPreference;
@JGeraldoLima
JGeraldoLima / TimeZonePreference.java
Last active March 20, 2018 16:13
Android TimeZone preference using 100% native resources, with no need to read timezones from external files. Automatically sorted and translated.
package <your_package>;
import android.content.Context;
import android.util.AttributeSet;
/* You can use default ListPreference if you prefer.
Got this lib from <link>https://github.com/afollestad/material-dialogs</link>
*/
import com.afollestad.materialdialogs.prefs.MaterialListPreference;