Skip to content

Instantly share code, notes, and snippets.

View tokou's full-sized avatar

Tarek Belkahia tokou

View GitHub Profile
@ZacSweers
ZacSweers / Notes.md
Last active January 31, 2023 00:24
MergeFileTask Patch

The Problem

While doing some remote build cache fidelity testing in #66841, I found that our lint analysis tasks were consistently getting cache misses due to an esoteric intermediate proguard file contents change.

After a little digging, I found these files were generated by AGP as a "merged" file of all that project's generated proguard files. This was most notable in projects using Moshi, which generates proguard rules on the fly.

My hunch was that these files were being merged with non-deterministic order, as I couldn't find anything that ensured ordering and this input was purely a file contents check (so the same rules in different order would still constitute a miss).

I was able to verify this was the case via snagging merged proguard.txt files via github actions artifact uploads.

I filed this issue for it here: issuetracker.google.com/issues/266403349 (note it's been made private for some reason).

@LouisCAD
LouisCAD / !README.md
Created February 28, 2019 11:31 — forked from Ribesg/!README.md
How to use an iOS Framework in a Kotlin MPP library published to Maven

This gist demonstrates how to build a Kotlin MPP library so that the iOS sourceSet depends on and uses an iOS Framework as a dependency.

Key ideas:

  • We use [Carthage] to retrieve/build the iOS Framework.
  • We use [cinterop] to create bindings allowing us to use the iOS Framework from Kotlin
  • We build and publish the library using ./gradlew publishToMavenLocal
  • We build and publish [klib] artifacts for both the arm64 and x86_64 architectures, you can easily add arm32 if you need.
  • Note that the publish process also publishes a cinterop klib artifact, allowing dependents to also know about the iOS Framework headers.

You can find a gist explaining how to use such library in an iOS app [here][ios-app].

@zokipirlo
zokipirlo / DividerItemDecoration.java
Last active June 23, 2022 14:59 — forked from lapastillaroja/DividerItemDecoration.java
DividerItemDecoration. RecyclerView.ItemDecoration simple implementation
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
package com.nabilhachicha.myapplication;
import android.app.Activity;
import android.os.Bundle;
import android.os.StrictMode;
import android.util.Log;
import com.squareup.okhttp.Cache;
import com.squareup.okhttp.Interceptor;
import com.squareup.okhttp.OkHttpClient;
@gabrielemariotti
gabrielemariotti / Readme.md
Last active March 2, 2024 23:10
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example:

@cbeyls
cbeyls / WindowInsetsFrameLayout.java
Last active February 5, 2020 10:58
A fragment container enabling the use of android:fitsSystemWindows in fragment layouts.
package be.digitalia.common.widgets;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Rect;
import android.os.Build;
import android.support.v4.util.ObjectsCompat;
import android.util.AttributeSet;
import android.view.View;
@JakeWharton
JakeWharton / ForegroundImageView.java
Created July 10, 2014 16:42
An ImageView which supports a foreground drawable.
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.ImageView;
public class ForegroundImageView extends ImageView {
private Drawable foreground;
@wbroek
wbroek / genymotionwithplay.txt
Last active February 12, 2024 03:22
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@hemanth
hemanth / link_list
Created April 9, 2013 05:18
Ask HN: What's the best technical talk you've heard? [Links]