Skip to content

Commit

Permalink
Preparing for material design - switching from ActionBar to ToolBar
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanZoR committed Feb 14, 2015
1 parent aef170f commit b2be4ba
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/src/main/java/com/tipz/app/view/BaseActivity.java
Expand Up @@ -2,22 +2,23 @@

import android.app.Application;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.support.v7.widget.Toolbar;

import com.tipz.app.R;

public abstract class BaseActivity<T extends Application> extends ActionBarActivity {

protected final String TAG = ((Object) this).getClass().getSimpleName();

protected T mApp;

protected ActionBar mActionBar;
protected Toolbar mToolbar;

protected boolean mIsResumed = false;

@Override
public void onCreate(Bundle savedInstanceState) {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Just inflate the activity layout
Expand All @@ -30,7 +31,8 @@ public void onCreate(Bundle savedInstanceState) {
mApp = (T) getApplication();

// Action bar setup
mActionBar = getSupportActionBar();
mToolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(mToolbar);

This comment has been minimized.

Copy link
@SeanZoR

SeanZoR Feb 22, 2015

Author Owner

Tip: Prefer Toolbar over ActionBar - If you are starting out your implementation, and not sure what direction will your app UX/UI will go, prefer using a Toolbar over ActionBar - that will give you more flexibility in controlling that area and fitting it to material design interactions (The former ActionBar gave the developers minimum control over it, having it difficult to manipulate it to your needs.)

}

@Override
Expand Down

0 comments on commit b2be4ba

Please sign in to comment.