mirror of
https://github.com/jrpie/Launcher.git
synced 2025-02-23 06:21:31 +01:00
Add Information and Links
This commit is contained in:
parent
5a2ff95c15
commit
6cb06b3095
2 changed files with 61 additions and 8 deletions
|
@ -6,7 +6,9 @@ import android.content.Intent
|
|||
import android.content.SharedPreferences
|
||||
import android.content.pm.PackageManager
|
||||
import android.content.pm.ResolveInfo
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.text.Html
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.KeyEvent
|
||||
import android.view.MotionEvent
|
||||
|
@ -17,6 +19,7 @@ import android.widget.Toast
|
|||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.MotionEventCompat
|
||||
import kotlinx.android.synthetic.main.activity_main.*
|
||||
import kotlinx.android.synthetic.main.activity_settings.*
|
||||
import kotlin.math.abs
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
@ -66,6 +69,23 @@ class SettingsActivity : AppCompatActivity() {
|
|||
startActivityForResult(intent, 5000)
|
||||
}
|
||||
|
||||
fun openNewTabWindow(urls: String, context : Context) {
|
||||
val uris = Uri.parse(urls)
|
||||
val intents = Intent(Intent.ACTION_VIEW, uris)
|
||||
val b = Bundle()
|
||||
b.putBoolean("new_window", true)
|
||||
intents.putExtras(b)
|
||||
context.startActivity(intents)
|
||||
}
|
||||
|
||||
fun openFinnWebsite(view: View) {
|
||||
openNewTabWindow("https://www.finnmglas.com/", this)
|
||||
}
|
||||
|
||||
fun openGithubRepo(view: View) {
|
||||
openNewTabWindow("https://github.com/finnmglas/Launcher", this)
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n") // I do not care
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
|
|
@ -174,18 +174,51 @@
|
|||
|
||||
enter image description here
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sub_head_2"
|
||||
android:layout_width="wrap_content"
|
||||
<TableLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="About"
|
||||
android:textColor="#999"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.1"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/actionschooser"
|
||||
app:layout_constraintVertical_bias="0.65" />
|
||||
app:layout_constraintVertical_bias="0.9">
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="By "
|
||||
android:textColor="#999"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="openFinnWebsite"
|
||||
android:text="Finn M Glas"
|
||||
android:textColor="?attr/colorAccent"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" | "
|
||||
android:textColor="#999"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="openGithubRepo"
|
||||
android:text="Open Source"
|
||||
android:textColor="?attr/colorAccent"
|
||||
android:textSize="18sp" />
|
||||
</TableRow>
|
||||
|
||||
</TableLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Add table
Reference in a new issue