Skip to content

Instantly share code, notes, and snippets.

@rafaelsm
rafaelsm / Theme.kt
Created November 26, 2021 18:10 — forked from Bradleycorn/Theme.kt
An Example Theme for Jetpack Compose that uses the built-in Material Theme, but adds a single extra color, "Tertiary".
package net.bradball.android.androidapptemplate.ui.theme
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.compose.ui.graphics.Color
private val DarkColorPalette = AppColors(
materialColors = darkColors(
primary = purple200,
@rafaelsm
rafaelsm / gist:a320185cf9781aad413bb47502cba4ad
Created April 28, 2021 14:38
Fix Android emulator in macOS Big Sur
First create an xml file anywhere named entitlements.xml with this content:
```
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.hypervisor</key>
<true/>
@rafaelsm
rafaelsm / netshoes_challenge.txt
Created March 27, 2019 20:18
Netshoes challenge
# mobile-recruitament
The app need to be written in Java, Kotlin or both
App Description
- The app must list all public gist with pagination (the number of gists per page is up to you)
- Each gist must show author name with avatar, Gist title and language
- Show gist details in another screen (Fragment or Activity), with the following infos: author name with avatar, gist title and language
- Display raw file content in another screen
- Must have an option to save the gist as favorite (device storage)
@rafaelsm
rafaelsm / XposedUtils.java
Created November 28, 2018 15:45 — forked from jaredrummler/XposedUtils.java
Utility methods for checking if the Xposed framework is installed.
/*
* Copyright (C) 2016 Jared Rummler <jared.rummler@gmail.com>
*
* 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
@rafaelsm
rafaelsm / gist:c302c95c106e4cbb6f606d4e6537ae28
Created September 26, 2018 21:18 — forked from y-gagar1n/gist:8469484
DateTime format patterns
DateTime.ToString() Patterns
All the patterns:
0 MM/dd/yyyy 08/22/2006
1 dddd, dd MMMM yyyy Tuesday, 22 August 2006
2 dddd, dd MMMM yyyy HH:mm Tuesday, 22 August 2006 06:30
3 dddd, dd MMMM yyyy hh:mm tt Tuesday, 22 August 2006 06:30 AM
4 dddd, dd MMMM yyyy H:mm Tuesday, 22 August 2006 6:30
5 dddd, dd MMMM yyyy h:mm tt Tuesday, 22 August 2006 6:30 AM
@rafaelsm
rafaelsm / Android SwitchPlusClickPreference
Created August 9, 2018 18:40 — forked from marchold/Android SwitchPlusClickPreference
extension of SwitchPreference that allows you to add a click handler to the preference area as well as the switch. For making switch preferences that work like Android WiFi settings.
import android.content.Context;
import android.preference.SwitchPreference;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Switch;
/**
* Custom preference for handling a switch with a clickable preference area as well
@rafaelsm
rafaelsm / EditTextMatchers.java
Created October 10, 2016 15:23 — forked from JehandadK/EditTextMatchers.java
Espresso: Match EditText error text
package smuldr.espresso.util;
import android.content.res.Resources;
import android.support.test.espresso.matcher.BoundedMatcher;
import android.view.View;
import android.widget.EditText;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
/**
* Copyright 2013 Alex Yanchenko
*
* 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