various ui tweaks
Signed-off-by: androidacy-user <opensource@androidacy.com>pull/89/head
parent
89e2d8014b
commit
857ab8d7ba
@ -0,0 +1,35 @@
|
||||
package com.fox2code.mmm
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import com.fox2code.foxcompat.app.FoxActivity
|
||||
import com.google.android.material.button.MaterialButton
|
||||
|
||||
class ExpiredActivity : FoxActivity() {
|
||||
@SuppressLint("RestrictedApi")
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_expired)
|
||||
// download_button leads to the download page and uninstall_button leads to the uninstall dialog
|
||||
val downloadBtn = findViewById<MaterialButton>(R.id.download_button)
|
||||
val uninstallBtn = findViewById<MaterialButton>(R.id.uninstall_button)
|
||||
downloadBtn.setOnClickListener {
|
||||
// open https://www.androidacy.com/downloads/?view=FoxMMM
|
||||
startActivity(
|
||||
Intent(
|
||||
Intent.ACTION_VIEW,
|
||||
Uri.parse("https://www.androidacy.com/downloads/?view=FoxMMM")
|
||||
)
|
||||
)
|
||||
}
|
||||
uninstallBtn.setOnClickListener {
|
||||
// open system uninstall dialog
|
||||
val intent = Intent(Intent.ACTION_DELETE)
|
||||
// discover our package name
|
||||
intent.data = Uri.parse("package:$packageName")
|
||||
startActivity(intent)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ExpiredActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/mainexpiredlayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:layout_width="96dp"
|
||||
android:layout_height="96dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="12dp"
|
||||
android:src="@drawable/ic_baseline_warning_24" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="12dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/expired"
|
||||
android:textAlignment="center"
|
||||
android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="12dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/expired_message"
|
||||
android:textAlignment="center"
|
||||
android:textAppearance="@style/TextAppearance.Material3.BodyMedium" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginVertical="12dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/uninstall_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:text="@string/uninstall" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/download_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:text="@string/download_latest" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- bottom action bar with just app name -->
|
||||
<com.google.android.material.bottomappbar.BottomAppBar
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/bottomAppBar"
|
||||
android:layout_gravity="bottom"
|
||||
app:fabAlignmentMode="center"
|
||||
app:fabCradleMargin="10dp">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:text="@string/app_name_v2"
|
||||
android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall" />
|
||||
</com.google.android.material.bottomappbar.BottomAppBar>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
Loading…
Reference in New Issue