Skip to content

Instantly share code, notes, and snippets.

Avatar
👉
Check my profile

Ali Sajadi asajadi84

👉
Check my profile
  • Shahrekord University
  • Iran
View GitHub Profile
@asajadi84
asajadi84 / cookie.js
Created Jan 2, 2023
Express JS How to Set and Destroy Cookies (Explain Like I'm 5)
View cookie.js
@asajadi84
asajadi84 / RTLFriendlySnackbar.java
Created Aug 12, 2019
Android RTL friendly Snackbar
View RTLFriendlySnackbar.java
public void showSnackBar (String myString, boolean longTime) {
int duration = longTime? Snackbar.LENGTH_LONG : Snackbar.LENGTH_SHORT;
Snackbar mySnackbar = Snackbar.make(thePhoto, myString, duration);
View myView = mySnackbar.getView();
//use "android.support.design.R.id.snackbar_text" instead of "com.google.android.material" if you are not using Androidx
TextView myTextView = (TextView) myView.findViewById(com.google.android.material.R.id.snackbar_text);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1)
myTextView.setTextAlignment(View.TEXT_ALIGNMENT_TEXT_START);