Last active
March 3, 2018 14:43
-
-
Save sebaslogen/ffdcb15d641e3324c2e4fa0a6002135b to your computer and use it in GitHub Desktop.
Imaginary new Android Toolbar constructor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Toolbar extends ViewGroup { | |
public Toolbar(Context context, @Nullable AttributeSet attrs) { | |
this(context, attrs, getToolbarStyle()); | |
} | |
private static int getToolbarStyle() { | |
return (BuildConfig.VERSION_CODE >= Build.VERSION_CODES.O) ? R.attr.newCompatToolbarStyle : R.attr.toolbarStyle; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment