Skip to content

Instantly share code, notes, and snippets.

View alorma's full-sized avatar
🤡

Bernat Borrás Paronella alorma

🤡
View GitHub Profile
@dlew
dlew / themes-debug.xml
Last active March 1, 2024 15:46
With the new theming in AppCompat, a lot of assets are tinted automatically for you via theme attributes. That has often led me to wonder "where the hell did this color come from?" You can replace your normal theme with this debug theme to help figure out the source of that color.
<!-- You can change the parent around to whatever you normally use -->
<style name="DebugColors" parent="Theme.AppCompat">
<!-- System colors -->
<item name="android:windowBackground">@color/__debugWindowBackground</item>
<item name="android:colorPressedHighlight">#FF4400</item>
<item name="android:colorLongPressedHighlight">#FF0044</item>
<item name="android:colorFocusedHighlight">#44FF00</item>
<item name="android:colorActivatedHighlight">#00FF44</item>
@gabrielemariotti
gabrielemariotti / README.md
Last active March 1, 2024 15:46
How to manage the firebase libraries in a multi-module projects

Centralize the firebase libraries dependencies in gradle

ext {
      firebaseVersion = '9.0.0';

      firebaseDependencies = [
              core :         "com.google.firebase:firebase-core:${firebaseVersion}",
              database :     "com.google.firebase:firebase-database:${firebaseVersion}",
              storage :      "com.google.firebase:firebase-storage:${firebaseVersion}",
@steveliles
steveliles / Foreground.java
Last active January 22, 2024 18:06
Class for detecting and eventing whether an Android app is currently foreground or background (requires API level 14+)
package com.sjl.util;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import java.util.List;
@pedrovgs
pedrovgs / MVP_discussion.md
Last active August 2, 2023 16:53
Interfaces for presenters in MVP are a waste of time!

##Interfaces for presenters in MVP are a waste of time!

It's been a long time since we started talking about MVP. Today, the discussion is about if creating an interface for the Presenter in MVP is needed.

This is the Model View Presenter pattern's schema:

MVP Schema

In this schema the Model box is related to all the code needed to implement your business logic, the presenter is the class implementing the presentation logic and the view is an interface created to abstract the view implementation.

@amake
amake / android-7-localization.org
Last active July 25, 2023 22:34
Correct localization on Android 7

Correct localization on Android 7

Prior to Android 7, the system had a single preferred locale, and fallback behavior was quite rudimentary. Starting with Android 7, the user can now specify a priority list of locales, and fallback behavior is improved.

However, in many cases it is still surprisingly difficult to make full use of locale fallback, and there are some hidden gotchas when trying to fully support both Android 7 and earlier versions.

Reverse interview

Engineering

  1. What tech stack do you use? Are you rolling out new technologies or sunsetting older ones? Do you have any legacy system that you need to maintain?
  2. What is your maturity stage? Finding a direction, feature work, maintenance...
  3. What are the next big engineering challenges you will face?
  4. How are requirements delivered to the engineering teams? How are technical decisions made and communicated?
  5. What level of involvement do engineers have in relation to architecture and system design? How much freedom for decision making do individual developers have? What happens if an engineer identifies areas of improvement?
  6. What is the junior/senior balance of the team?
@chrisbanes
chrisbanes / CollapsingTitleLayout.java
Last active March 26, 2023 11:58
CollapsingTitleLayout
/*
* Copyright 2014 Chris Banes
*
* 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
@Sloy
Sloy / local.settings.gradle.kts
Last active October 25, 2022 10:56
Replacing libraries with local projects in Gradle. More https://publicobject.com/2021/03/11/includebuild/
val CaptainCrunch = Lib("../android-common--lib-android-captain-crunch", "com.adevinta.android:captaincrunch" to ":captaincrunch")
val AndroidExtensions = Lib("../android-common--lib-android-extensions", "com.adevinta.android:android-extensions" to ":android-extensions")
val Barista = Lib("../Barista", "com.schibsted.spain:barista" to ":library")
val AbTestingRunner = Lib(
"../android-common--lib-abtesting-runner",
"com.adevinta.android:abtesting" to ":abtesting",
"com.adevinta.android:abtesting-apptimize" to ":abtesting-apptimize",
"com.adevinta.android:abtesting-optimizely" to ":abtesting-optimizely",
"com.adevinta.android:abtesting-debug" to ":abtesting-debug",
"com.adevinta.android:abtesting-debugdrawer" to ":abtesting-debugdrawer",
@homj
homj / GridSpanSizeLookupHelper.java
Last active June 30, 2022 02:39
A ItemDecoration to center the contents of a RecyclerView. This comes in handy when you want to build a responsive UI.
/*
* Copyright 2015 Johannes Homeier
*
* 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
/*
* Copyright 2016 Google Inc.
*
* 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