Skip to content

Instantly share code, notes, and snippets.

View tranngoclam's full-sized avatar
🇻🇳
Vietnam

Lam Tran tranngoclam

🇻🇳
Vietnam
View GitHub Profile
@tranngoclam
tranngoclam / PatternEditableBuilder.java
Created September 13, 2017 10:40 — forked from nesquena/PatternEditableBuilder.java
PatternEditableBuilder - Easy way to create colored clickable spans within a TextView!
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.regex.Matcher;
@tranngoclam
tranngoclam / Container.go
Created October 22, 2017 04:11 — forked from urakozz/Container.go
Flat Buffers with Golang
// automatically generated, do not modify
package encoder
import (
flatbuffers "github.com/google/flatbuffers/go"
)
type Container struct {
_tab flatbuffers.Table
}
@tranngoclam
tranngoclam / BaseBottomNavActivity.java
Created December 30, 2017 03:23 — forked from adroitandroid/BaseBottomNavActivity.java
Custom bottom navigation bar
abstract class BaseBottomNavActivity extends BaseActivity { // you can directly extend AppCompatActivity
@Override
@CallSuper
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initOnCreate(savedInstanceState);
getBottomNavigationBar().setOnTabSelectionListener(
new CustomBottomNavigationBar.OnTabSelectionListener() {
@Override
import org.junit.Test;
import java.util.concurrent.TimeUnit;
import rx.Observable;
import rx.Scheduler;
import rx.functions.Func1;
import rx.observers.AssertableSubscriber;
import rx.schedulers.TestScheduler;
@tranngoclam
tranngoclam / activity_main2.xml
Created February 16, 2018 14:59 — forked from mohamedebrahim96/activity_main2.xml
The function of the button at the center is to call an activity and the TabLayout will be place at the bottom of the screen.
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.vacuum.app.cinema.MainActivity">
<!--SOME CODE FOR MY AppBarLayout-->
<!--SOME CODE FOR MY ToolBar-->