Skip to content

Instantly share code, notes, and snippets.

View seupedro's full-sized avatar

Seu Pedro seupedro

View GitHub Profile
@seupedro
seupedro / DrawerActivity.java
Last active February 13, 2018 22:23 — forked from libinbensin/DrawerActivity
Android Navigation Drawer with Activities
public class DrawerActivity extends ActionBarActivity {
private DrawerLayout mDrawerLayout = null;
private ListView mDrawerList = null;
private String[] mDrawerItems;
private ActionBarDrawerToggle mDrawerToggle = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_drawer_layout);
@seupedro
seupedro / AppBaseActivity.java
Created January 27, 2018 16:54
Android: Easiest way to reuse a common Navigation drawer among a group of activities.
/*
* This is a simple and easy approach to reuse the same
* navigation drawer on your other activities. Just create
* a base layout that conains a DrawerLayout, the
* navigation drawer and a FrameLayout to hold your
* content view. All you have to do is to extend your
* activities from this class to set that navigation
* drawer. Happy hacking :)
* P.S: You don't need to declare this Activity in the
* AndroidManifest.xml. This is just a base class.
public class ReportCard {
//Defining variables
private String mMateria;
private double mNota;
//Constructor
public ReportCard( String materia, double nota){
mMateria = materia;
mNota = nota;
}
//Getter Methods
@seupedro
seupedro / AccessModifier.java
Last active January 10, 2018 19:32
Modificador de Acesso - Access Modifier Android
public class Carro {
private int mModelo;
public Carro() {
mModelo = 0;
setup();
}
public Carro(int modelo) {