Skip to content

Instantly share code, notes, and snippets.

View yoosinpaddy's full-sized avatar

Yoosin Paddy yoosinpaddy

View GitHub Profile
@yoosinpaddy
yoosinpaddy / remaining_time.dart
Created February 14, 2022 21:19
Get More friendly remaining time from date and time string in flutter
String getRemainingTime(String? deadline) {
String toRet = "";
int remSecs = secondsBetween(DateTime.now(), DateTime.parse(deadline!));
if (remSecs < 0) {
isUrgent=true;
toRet = "Overdue by ";
remSecs = remSecs * -1;
}
int mdays = (remSecs / 86400).truncate();
@yoosinpaddy
yoosinpaddy / MainActivity.java
Created May 25, 2021 21:31
prevent screenshot in android app
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,WindowManager.LayoutParams.FLAG_SECURE);
//add this code in the oncreate of an activity before set content view
googlemap.addMarker(new MarkerOptions()
.position(new LatLng( 65.07213,-2.109375))
.title("This is my title")
.snippet("and snippet")
.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_ORANGE)));///This is orange color