xxxxxxxxxx
/**
* for place API Key
*/
fun getPlaceApiKey(): String {
var placeApiKey = helper.mapKey?.let { it } ?: BuildConfig.MAP_KEY
if (placeApiKey.isEmpty())
placeApiKey = BuildConfig.MAP_KEY
if (BuildConfig.APPLICATION_ID.equals("com.uffizio.trakzee", ignoreCase = true)
|| BuildConfig.APPLICATION_ID.equals("com.uffizio.trakzeelocal", ignoreCase = true)) {
placeApiKey = BuildConfig.TRAKZEE_GOOGLE_KEY
}
return placeApiKey
}
xxxxxxxxxx
private fun emitBubbles() {
// It will create a thread and attach it to
// the main thread
Handler().postDelayed({
// Random is used to select random bubble
// size
val size = Random.nextInt(20, 80)
bubbleEmitter.emitBubble(size)
bubbleEmitter.setColors(android.R.color.black,
android.R.color.black,
android.R.color.black);
emitBubbles()
}, Random.nextLong(100, 500))
}
xxxxxxxxxx
private fun emitBubbles() {
// It will create a thread and attach it to
// the main thread
Handler().postDelayed({
// Random is used to select random bubble
// size
val size = Random.nextInt(20, 80)
bubbleEmitter.emitBubble(size)
bubbleEmitter.setColors(android.R.color.black,
android.R.color.black,
android.R.color.black);
emitBubbles()
}, Random.nextLong(100, 500))
}
xxxxxxxxxx
private var imageCapture: ImageCapture? = null
private lateinit var outputDirectory: File
private lateinit var cameraExecutor: ExecutorService
xxxxxxxxxx
val pfd = context.contentResolver.openFileDescriptor(uri, "w")
val fd = pfd.fileDescriptor
val image = BitmapFactory.decodeFileDescriptor(fd)
pfd.close()
xxxxxxxxxx
private fun startUpdateTimer() {
timer = Timer()
timer?.scheduleAtFixedRate(object : TimerTask() {
override fun run() {
// only the UI thread can edit the activity appearance
this@MainActivity.runOnUiThread {
updateUI()
if (!countdownServiceRunning) {
stopUpdateTimer()
}
}
}
}, 100, 1000)
}
xxxxxxxxxx
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.web_view_foto_activity);
webView = (WebView) findViewById(R.id.webViewfoto);
webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setLoadWithOverviewMode(true);
webSettings.setAllowFileAccess(true);
webView.setWebViewClient(new Client());
webView.setWebChromeClient(new ChromeClient());
if (Build.VERSION.SDK_INT >= 30) {
webView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
}
else if(Build.VERSION.SDK_INT >=11 && Build.VERSION.SDK_INT < 30) {
webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
webView.loadUrl("https://sportfischerverein-onstmettingen.jagen-fuer-jaeger.de/sfv-onstmettingen/fangmeldung"); //change with your website
}