Bimba.git

ref: 343255d5c2e7108dd510ca9e7707d2d3d67e0bc6

app/src/main/java/xyz/apiote/bimba/czwek/AboutActivity.kt


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// SPDX-FileCopyrightText: Adam Evyčędo
//
// SPDX-License-Identifier: GPL-3.0-or-later

package xyz.apiote.bimba.czwek

import android.content.Intent
import android.net.Uri
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.updatePadding
import xyz.apiote.bimba.czwek.databinding.ActivityAboutBinding
import kotlin.math.max


class AboutActivity : AppCompatActivity() {
	private var _binding: ActivityAboutBinding? = null
	private val binding get() = _binding!!
	override fun onCreate(savedInstanceState: Bundle?) {
		enableEdgeToEdge()
		super.onCreate(savedInstanceState)
		_binding = ActivityAboutBinding.inflate(layoutInflater)
		setContentView(binding.root)

		ViewCompat.setOnApplyWindowInsetsListener(binding.root) { v, windowInsets ->
			val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
			val l = max(windowInsets.displayCutout?.safeInsetLeft ?: 0, insets.left)
			val r = max(windowInsets.displayCutout?.safeInsetRight ?: 0, insets.right)
			val t = max(windowInsets.displayCutout?.safeInsetTop ?: 0, insets.top)
			v.updatePadding(left = l, right = r, top = t)
			windowInsets
		}

		binding.mastodon.setOnClickListener {
			startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://floss.social/@bimba")))
		}
		binding.website.setOnClickListener {
			startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://bimba.apiote.xyz")))
		}
		binding.code.setOnClickListener {
			startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://git.apiote.xyz/Bimba.git")))
		}
		binding.translate.setOnClickListener {
			startActivity(
				Intent(
					Intent.ACTION_VIEW,
					Uri.parse("https://hosted.weblate.org/projects/bimba/")
				)
			)
		}
	}
}