This file contains 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
import android.content.Context; | |
import android.util.DisplayMetrics; | |
import android.view.WindowManager; | |
/** | |
* Created by maulik santoki on 17/10/17. | |
*/ | |
public class ScreenUtils { |
This file contains 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
/* | |
reference link ->https://www.opengeeks.me/2015/08/filechooser-and-android-webview/ | |
https://github.com/OpenGeeksMe/Android-File-Chooser | |
*/ | |
import android.app.Activity; | |
import android.app.ProgressDialog; | |
import android.content.Intent; | |
import android.graphics.Bitmap; | |
import android.net.Uri; |
This file contains 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
import android.webkit.WebView; | |
/** | |
* Created by mauliksantoki on 6/11/17. | |
*/ | |
public class WebviewUtil { | |
// Reference https://forums.xamarin.com/discussion/40192/how-to-do-a-webview-renderer-with-custom-font-on-android |
This file contains 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
import java.util.Collection; | |
import java.util.LinkedHashSet; | |
import java.util.Set; | |
import android.app.Activity; | |
import android.content.ActivityNotFoundException; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.net.Uri; | |
import android.support.annotation.NonNull; |
This file contains 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 static String removeZero(String str) | |
{ | |
// Count leading zeros | |
int i = 0; | |
while (str.charAt(i) == '0') | |
i++; | |
// Convert str into StringBuffer as Strings | |
// are immutable. | |
StringBuffer sb = new StringBuffer(str); |
This file contains 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
fun getMeters(miles: Double): Double { | |
return miles * 1609.344 | |
} |
This file contains 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
fun getBearing(begin: LatLng, end: LatLng): Float { | |
val lat = abs(x = begin.latitude - end.latitude) | |
val lng = abs(x = begin.longitude - end.longitude) | |
if (begin.latitude < end.latitude && begin.longitude < end.longitude) | |
return (Math.toDegrees(Math.atan(lng / lat)).toFloat()) | |
else if (begin.latitude >= end.latitude && begin.longitude < end.longitude) | |
return (((90 - Math.toDegrees(Math.atan(lng / lat))) + 90).toFloat()) | |
else if (begin.latitude >= end.latitude && begin.longitude >= end.longitude) | |
return ((Math.toDegrees(Math.atan(lng / lat)) + 180).toFloat()) |
This file contains 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
abstract class BaseDataBindingBottomSheetDialogFragment : BottomSheetDialogFragment() { | |
private var mProgressDialog: Dialog? = null | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
initControl() | |
initView(view) | |
setListener() |
This file contains 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
./gradlew tasks |
OlderNewer