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 / 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:

@jesselima
jesselima / RoundedBottomSheetDialogFragment.kt
Created April 25, 2019 23:02 — forked from ArthurNagy/RoundedBottomSheetDialogFragment.kt
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
@jesselima
jesselima / BaseDao.kt
Created April 21, 2019 01:34 — forked from florina-muntenescu/BaseDao.kt
Use Dao inheritance to reduce the amount of boilerplate code - https://medium.com/google-developers/7-pro-tips-for-room-fbadea4bfbd1
/*
* 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