Skip to content

Instantly share code, notes, and snippets.

View FilipeLipan's full-sized avatar
🎯
Focusing

Filipe Schmidt FilipeLipan

🎯
Focusing
  • Curitiba Paraná
View GitHub Profile
@FilipeLipan
FilipeLipan / gist:ddbf97500cc2e6a5ac062ef15fe214bc
Created July 20, 2017 13:20
Make grid RecyclerView change it span for some views
mRecyclerView = (RecyclerView) findViewById(R.id.rv);
list = generateData();
adapter = new ExpandableItemAdapter(list);
final GridLayoutManager manager = new GridLayoutManager(this, 3);
manager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override
public int getSpanSize(int position) {
return adapter.getItemViewType(position) == ExpandableItemAdapter.TYPE_PERSON ? 1 : manager.getSpanCount();
@FilipeLipan
FilipeLipan / gits
Last active November 7, 2017 18:25
even-functions-push
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
exports.sendPush = functions.database.ref('/snptee/inbox/{userUiid}/{chatId}/{lastMessage}').onWrite(event => {
let userUiid = event.params.userUiid;
let chatId = event.params.chatId;
var lastMessage = event.data.val();
SearchView searchView;
CompositeDisposable compositeDisposable = new CompositeDisposable();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
searchView = (SearchView) findViewById(R.id.search_view);
var bundle = Bundle()
bundle.putString("este é um teste com bundles", "this a call to all my past resignations")
bundle.putInt("quantidade de cupons", 1)
bundle.putLong("", 1)
val userProperty = UserProperty(name = "fil", email = "test", extra = bundle);
for (prop in UserProperty::class.memberProperties) {
prop.get(userProperty)?.let {
if(prop.returnType.jvmErasure.isSubclassOf(Bundle::class)){
class GroupUpdateStatusEnum {
companion object {
@IntDef(OPTION1, OPTION2)
@Retention(AnnotationRetention.SOURCE)
annotation class GroupUpdateStatus
const val OPTION1 = 2L
const val OPTION2 = 3L
query LoadGithubRepositories($login: String!){
user(login: $login) {
repositories(first:20){
nodes{
id
name
}
}
}
private val BASE_URL = "https://api.github.com/graphql"
private lateinit var apolloClient: ApolloClient
**********
apolloClient = ApolloClient.builder()
.serverUrl(BASE_URL)
.okHttpClient(okHttpClient)
.build()
class App : Application() {
private val BASE_URL = "https://api.github.com/graphql"
//TODO: put your token here man!!!
private val GITHUB_AUTH_TOKEN = ""
private lateinit var apolloClient: ApolloClient
override fun onCreate() {
lateinit var githubRepositoriesCall: ApolloCall<LoadGithubRepositoriesQuery.Data>
********
val loadGithubMembersQuery: LoadGithubRepositoriesQuery = LoadGithubRepositoriesQuery.builder()
.login("FilipeLipan")
.build();
githubRepositoriesCall = application.apolloClient()
.query(loadGithubMembersQuery)
package com.xxmassdeveloper.mpchartexample;
import android.graphics.Color;
import android.graphics.LinearGradient;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Shader;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;