1
0
Fork 0
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:
Gregor Santner 2019-11-20 00:34:10 +01:00
parent 1948c28cff
commit 7361d4bc3f
No known key found for this signature in database
GPG key ID: 7E83A7834AECB009
9 changed files with 286 additions and 112 deletions

View file

@ -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;
}
}
}