Skip to content

Instantly share code, notes, and snippets.

🌟
Focusing

Ansh Sachdeva root-ansh

🌟
Focusing
View GitHub Profile
@root-ansh
root-ansh / AllStyles.xml
Created Jul 1, 2018
Default generated files for the navigation drawer
View AllStyles.xml
<!-- styles.xml -->
<resources>
<!-- 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>
</style>
View NougatNotifications.java
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
root-ansh / ToolbarAlphaScrollBehavior
Created Apr 14, 2018 — forked from NikolaDespotoski/ToolbarAlphaScrollBehavior.java
Toggle Toolbar background alpha and alpha of its title view.
View ToolbarAlphaScrollBehavior
public class ToolbarAlphaScrollBehavior extends CoordinatorLayout.Behavior<android.support.v7.widget.Toolbar> {
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
root-ansh / LoginActivity.java
Created Nov 25, 2017 — forked from cutiko/LoginActivity.java
How to customize firebase-ui-auth for Android
View LoginActivity.java
public class LoginActivity extends AppCompatActivity {
private static final int RC_SIGN_IN = 343;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
You can’t perform that action at this time.