Skip to content

Instantly share code, notes, and snippets.

View Sottti's full-sized avatar
🏠
Remote

Pablo Costa Sottti

🏠
Remote
View GitHub Profile
@Sottti
Sottti / User.java
Last active September 22, 2018 08:02
public class User {
private String name;
private int age;
public User(String name, int age) {
this.name = name;
this.age = age;
}
@Sottti
Sottti / MyActivity.java
Last active January 18, 2021 09:29
Handles clicks on a EditText right drawable
[...]
mEditText.setOnTouchListener(
new OnEditTextRightDrawableTouchListener(mEditText) {
@Override
public void OnDrawableClick() {
// The right drawable was clicked. Your action goes here.
}
});
[...]
@Sottti
Sottti / MyFragment.java
Last active June 25, 2017 10:14
Allow Android Map to scroll when within an scrollable container
(...)
mSupportMapFragment = (OnScrollableContainerMapFragment) getChildFragmentManager()
.findFragmentById(R.id.fragment_map);
mSupportMapFragment
.setOnTouchListener(new OnScrollableContainerMapFragment.OnTouchListener() {
@Override
public void onStartScrollingMap() {
mScrollView.requestDisallowInterceptTouchEvent(true);
}
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.util.AttributeSet;
import android.widget.LinearLayout;
public class AdaptiveTabLayout extends TabLayout
{
private boolean mGravityAndModeSeUpNeeded = true;
@Sottti
Sottti / ApiCalls.java
Created October 18, 2015 02:43
Retrofit set up
public class ApiCalls
{
public static Call<DummyObject> getDummyObjectCall()
{
return ApiServices
.getDummyService()
.getDummyObject();
}
public static Call<List<DummyObject>> getDummyObjectListCall()
@Sottti
Sottti / MainActivity.java
Last active November 7, 2019 09:20
Navigation Drawer Sizing according to Material Design
{...}
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.content.Context;
import android.content.Intent;
import android.graphics.PorterDuff;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;