Java Code Examples for android.support.v7.app.ActionBar.setElevation()

The following are Jave code examples for showing how to use setElevation() of the android.support.v7.app.ActionBar class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: MiPushFramework   File: EntityHeaderController.java   Source Code and License Vote up 6 votes
public EntityHeaderController styleActionBar(AppCompatActivity activity) {
    if (activity == null) {
        Log.w(TAG, "No activity, cannot style actionbar.");
        return this;
    }
    final ActionBar actionBar = activity.getSupportActionBar();
    if (actionBar == null) {
        Log.w(TAG, "No actionbar, cannot style actionbar.");
        return this;
    }
    actionBar.setBackgroundDrawable(
            new ColorDrawable(Utils.getColorAttr(activity, R.attr.colorSettings)));
    actionBar.setElevation(0);
    //if (mRecyclerView != null && mLifecycle != null) {
    //    ActionBarShadowController.attachToRecyclerView(mActivity, mLifecycle, mRecyclerView);
    //}

    return this;
}
 
Example 2
Project: Treebolic   File: TreebolicBasicActivity.java   Source Code and License Vote up 6 votes
@Override
protected void onCreate(final Bundle savedInstanceState)
{
	super.onCreate(savedInstanceState);

	// widget
	this.widget = new Widget(this, this);

	// content view
	setContentView(R.layout.activity_treebolic);
	final ViewGroup container = findViewById(R.id.container);
	final LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, 1.F);
	container.addView(this.widget, params);

	// toolbar
	final Toolbar toolbar = findViewById(R.id.toolbar);

	// action bar
	setSupportActionBar(toolbar);
	final ActionBar actionBar = getSupportActionBar();
	if (actionBar != null)
	{
		actionBar.setElevation(0);
		actionBar.setDisplayOptions(ActionBar.DISPLAY_USE_LOGO | ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_HOME_AS_UP);
	}
}
 
Example 3
Project: freehkkai-android   File: BaseActivity.java   Source Code and License Vote up 5 votes
protected ActionBar initActionBar(ActionBar ab, String title, String subtitle) {
	if (ab != null) {
		ab.setElevation(100);
		ab.setDisplayHomeAsUpEnabled(true);
		ab.setHomeButtonEnabled(true);
		ab.setTitle(title);

		if (subtitle != null) {
			ab.setSubtitle(subtitle);
		}
	}

	return ab;
}
 
Example 4
Project: freehkkai-android   File: BaseActivity.java   Source Code and License Vote up 5 votes
protected ActionBar initActionBar(ActionBar ab, int titleId, int subtitleId) {
	if (ab != null) {
		ab.setElevation(100);
		ab.setDisplayHomeAsUpEnabled(true);
		ab.setHomeButtonEnabled(true);
		ab.setTitle(titleId);

		if (subtitleId != 0) {
			ab.setSubtitle(subtitleId);
		}
	}
	return ab;
}
 
Example 5
Project: Treebolic   File: TreebolicClientActivity.java   Source Code and License Vote up 5 votes
@Override
protected void onCreate(final Bundle savedInstanceState)
{
	super.onCreate(savedInstanceState);

	// widget
	this.widget = new Widget(this, this);

	// content view
	setContentView(R.layout.activity_treebolic);
	final ViewGroup container = findViewById(R.id.container);
	container.addView(this.widget);

	// toolbar
	final Toolbar toolbar = findViewById(R.id.toolbar);

	// action bar
	setSupportActionBar(toolbar);
	final ActionBar actionBar = getSupportActionBar();
	if (actionBar != null)
	{
		actionBar.setElevation(0);
		actionBar.setDisplayOptions(ActionBar.DISPLAY_USE_LOGO | ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_HOME_AS_UP);
	}

	// init widget with model is asynchronous
}
 
Example 6
Project: content-farm-blocker-android   File: BaseActivity.java   Source Code and License Vote up 5 votes
protected ActionBar initActionBar(ActionBar ab, String title, String subtitle) {
	if (ab != null) {
		ab.setElevation(100);
		ab.setDisplayHomeAsUpEnabled(true);
		ab.setHomeButtonEnabled(true);
		ab.setTitle(title);

		if (subtitle != null) {
			ab.setSubtitle(subtitle);
		}
	}

	return ab;
}
 
Example 7
Project: content-farm-blocker-android   File: BaseActivity.java   Source Code and License Vote up 5 votes
protected ActionBar initActionBar(ActionBar ab, int titleId, int subtitleId) {
	if (ab != null) {
		ab.setElevation(100);
		ab.setDisplayHomeAsUpEnabled(true);
		ab.setHomeButtonEnabled(true);
		ab.setTitle(titleId);

		if (subtitleId != 0) {
			ab.setSubtitle(subtitleId);
		}
	}
	return ab;
}