Skip to content

Instantly share code, notes, and snippets.

View jesselima's full-sized avatar
📱
Coding for mobile...

Jesse Lima jesselima

📱
Coding for mobile...
View GitHub Profile
@jesselima
jesselima / AppBarStateChangedListener.java
Created March 19, 2022 19:59 — forked from ed-george/AppBarStateChangedListener.java
Simple listener to determine if the AppBarLayout of a view is collapsed or expanded
public abstract class AppBarStateChangedListener implements AppBarLayout.OnOffsetChangedListener {
public enum State {
EXPANDED,
COLLAPSED,
IDLE
}
private State mCurrentState = State.IDLE;
@jesselima
jesselima / ViewAnimationExtension.kt
Created February 18, 2021 16:18
Sample extension to show fadein with animation
package tech.jesselima.statistics.extensions
import android.animation.ObjectAnimator
import android.view.View
import android.view.animation.AnimationUtils
import tech.jesselima.commonextensions.R
fun View.showWithAnimatedFadeIn(
translationType: TranslationType = TranslationType.TRANSLATION_Y,
@jesselima
jesselima / RetrofitForKoinUse.kt
Created May 15, 2020 14:20
This is a Quick and easy way to use retrofit with koin.
private val apiModule = module {
// By default, Gson is strict and only accepts JSON as specified by RFC 4627 .
// This option makes the parser liberal in what it accepts
single { GsonBuilder().setLenient().create() }
single {
// val httpLoggingInterceptor = HttpLoggingInterceptor()
// httpLoggingInterceptor.level = HttpLoggingInterceptor.Level.NONE
val okHttpClient = OkHttpClient()
@jesselima
jesselima / add local aar file.md
Created May 14, 2020 14:46 — forked from shau-lok/add local aar file.md
Android Studio add local .aar reference

Add local .aar file

  1. basic build.gradle directory using flatDir
repositories {
    mavenCentral()
    flatDir {
 dirs 'libs'
@jesselima
jesselima / MainActivity.java
Created March 31, 2020 18:30 — forked from alexjlockwood/MainActivity.java
Sample usage of the "android.app.Application.ActivityLifecycleCallbacks" class.
public class MainActivity extends Activity {
private final MyActivityLifecycleCallbacks mCallbacks = new MyActivityLifecycleCallbacks();
@Override
protected void onCreate(Bundle savedInstanceState) {
// Always register before calling into the super class.
getApplication().registerActivityLifecycleCallbacks(mCallbacks);
super.onCreate(savedInstanceState);
@jesselima
jesselima / MainActivity.java
Created March 31, 2020 18:30 — forked from petterh/MainActivity.java
Sample usage of the "android.app.Application.ActivityLifecycleCallbacks" class.
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// Always register before calling into the super class.
getApplication().registerActivityLifecycleCallbacks(new MyActivityLifecycleCallbacks(this));
super.onCreate(savedInstanceState);
}
/*
* Copyright (C) 2017 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
@jesselima
jesselima / gist:09afcaf3c017ff56649f749b7c480b0a
Created March 3, 2020 03:59 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@jesselima
jesselima / README.md
Created January 21, 2020 00:48 — forked from gabrielemariotti/README.md
How to manage the support libraries in a multi-module projects. Thanks to Fernando Cejas (http://fernandocejas.com/)

Centralize the support libraries dependencies in gradle

Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries.

A very good way is to separate gradle build files, defining something like:

root
  --gradleScript
 ----dependencies.gradle
@jesselima
jesselima / android_studio_shortcuts.md
Created September 27, 2019 13:45 — forked from stkent/android_studio_shortcuts.md
Android Studio Shortcuts (Mac)

Android Studio Shortcuts (Mac)

Notes:

  • Two of the most useful shortcuts utilize the Fn (function) keys. It is therefore recommended that you enable the "Use all F1, F2, etc. keys as standard function keys" option [System Preferences > Keyboard].
  • Be sure to enable the Mac OS X 10.5+ keymap in Android Studio [Preferences > Keymap].
  • A fairly complete shortcut list can be found here.

Useful symbols: