mirror of
https://github.com/gsantner/dandelion
synced 2025-09-10 02:39:43 +02:00
Update opoc
Update shared helper utilities of my projects to latest state
This commit is contained in:
parent
1948c28cff
commit
7361d4bc3f
9 changed files with 286 additions and 112 deletions
|
@ -16,6 +16,7 @@ import android.support.annotation.LayoutRes;
|
|||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
|
@ -143,4 +144,17 @@ public abstract class GsFragmentBase extends Fragment {
|
|||
public Menu getFragmentMenu() {
|
||||
return _fragmentMenu;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the toolbar from activity
|
||||
* Requires id to be set to @+id/toolbar
|
||||
*/
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
protected Toolbar getToolbar() {
|
||||
try {
|
||||
return (Toolbar) getActivity().findViewById(new ContextUtils(getActivity()).getResId(ContextUtils.ResType.ID, "toolbar"));
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue