Skip to content

Instantly share code, notes, and snippets.


Ansh Sachdeva root-ansh

View GitHub Profile
root-ansh / AllStyles.xml
Created Jul 1, 2018
Default generated files for the navigation drawer
View AllStyles.xml
<!-- styles.xml -->
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
class NougatNotifications {
*========================================== STEP 1 =============================================*
* Bundled notification only works on Android N (API level 24) and above.
* So, you may want to check the platform version everywhere.
void step1() {
boolean isBundledNotification = Build.VERSION.SDK_INT >= Build.VERSION_CODES.N;
root-ansh / ToolbarAlphaScrollBehavior
Created Apr 14, 2018 — forked from NikolaDespotoski/
Toggle Toolbar background alpha and alpha of its title view.
View ToolbarAlphaScrollBehavior
public class ToolbarAlphaScrollBehavior extends CoordinatorLayout.Behavior<> {
private ColorDrawable mStatusBarColorDrawable;
private int mStatusBarColor;
private TextView mTitleView;
private boolean searchedForTitleView = false;
public ToolbarAlphaScrollBehavior(Context context, AttributeSet attrs) {
super(context, attrs);
mStatusBarColor = ContextCompat.getColor(context, R.color.primary_dark);
mStatusBarColor = getColorWithAlpha(0, mStatusBarColor);
root-ansh /
Created Nov 25, 2017 — forked from cutiko/
How to customize firebase-ui-auth for Android
public class LoginActivity extends AppCompatActivity {
private static final int RC_SIGN_IN = 343;
protected void onCreate(Bundle savedInstanceState) {
Toolbar toolbar = (Toolbar) findViewById(;
You can’t perform that action at this time.