Skip to content

Instantly share code, notes, and snippets.

View FrantisekGazo's full-sized avatar

František Gažo FrantisekGazo

  • Ventrata
  • Slovakia
View GitHub Profile
@FrantisekGazo
FrantisekGazo / StatefulRecyclerView.java
Last active November 10, 2024 22:57
Retain & restore recycler view scroll position
package eu.f3rog.ui.custom;
import android.content.Context;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
/**
@FrantisekGazo
FrantisekGazo / ViewPagerAdapter.java
Last active March 15, 2016 21:32
Easy to use PagerAdapter for Views. Best used in combination with MVP module of Blade library (https://github.com/FrantisekGazo/Blade)
package eu.f3rog.ui.adapter;
import android.content.Context;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.v4.view.PagerAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@FrantisekGazo
FrantisekGazo / RecyclerAdapter.java
Last active March 15, 2016 21:54
Simple RecyclerAdapter. Best used with MVP module of Blade library (https://github.com/FrantisekGazo/Blade)
package eu.f3rog.ui.adapter;
import android.content.Context;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
package eu.f3rog.ui.activity;
import android.os.Bundle;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import butterknife.Bind;
import butterknife.ButterKnife;
@FrantisekGazo
FrantisekGazo / blade.json
Created March 15, 2016 22:20
Configuration file for Blade library (https://github.com/FrantisekGazo/Blade)
{
"debug": false,
"modules": [
"arg",
"extra",
"state",
"mvp"
]
}
package eu.f3rog.db;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringDef;
import android.text.TextUtils;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
package eu.f3rog.db;
import com.j256.ormlite.field.FieldType;
import com.j256.ormlite.field.SqlType;
import com.j256.ormlite.field.types.BaseDataType;
import com.j256.ormlite.support.DatabaseResults;
import java.sql.SQLException;
/**
package eu.f3rog.db;
import android.support.annotation.Nullable;
import com.j256.ormlite.field.DatabaseField;
/**
* Class {@link CompositeIdObject}.
*
* @author Frantisek Gazo
@FrantisekGazo
FrantisekGazo / generate_keys.py
Created June 25, 2016 11:20
Python script for generating java enum/StringDef or swift enum based on keys in json file
#!/usr/bin/python
#######################################################################
#
# Script for generating java or swift class based on keys in json file.
#
# @author FrantisekGazo
# @version 2016-06-23
#
#######################################################################
@FrantisekGazo
FrantisekGazo / JustifyTextView.java
Last active October 28, 2016 09:55
TextView with justify alignment
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.os.Build;
import android.text.Layout;
import android.text.StaticLayout;
import android.text.TextPaint;
import android.util.AttributeSet;
import android.widget.TextView;