@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2023 to present Androidacy and contributors. Names, logos, icons, and the Androidacy name are all trademarks of Androidacy and may not be used without license. See LICENSE for more information.
|
||||
*/
|
||||
|
||||
package com.fox2code.mmm.utils
|
||||
|
||||
import android.content.Context
|
||||
import android.util.TypedValue
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ProgressBar
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.widget.LinearLayoutCompat
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
// ProgressDialog is deprecated because it's an bad UX pattern, but sometimes we have no other choice...
|
||||
enum class BudgetProgressDialog {
|
||||
;
|
||||
|
||||
companion object {
|
||||
fun build(context: Context, title: String?, message: String?): AlertDialog {
|
||||
val r = context.resources
|
||||
val padding = TypedValue.applyDimension(
|
||||
TypedValue.COMPLEX_UNIT_DIP,
|
||||
20f,
|
||||
r.displayMetrics
|
||||
).roundToInt()
|
||||
val v = LinearLayoutCompat(context)
|
||||
v.orientation = LinearLayoutCompat.HORIZONTAL
|
||||
val pb = ProgressBar(context)
|
||||
v.addView(
|
||||
pb,
|
||||
LinearLayoutCompat.LayoutParams(
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
1f
|
||||
)
|
||||
)
|
||||
val t = TextView(context)
|
||||
t.gravity = Gravity.CENTER
|
||||
v.addView(
|
||||
t,
|
||||
LinearLayoutCompat.LayoutParams(
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
4f
|
||||
)
|
||||
)
|
||||
v.setPadding(padding, padding, padding, padding)
|
||||
t.text = message
|
||||
return MaterialAlertDialogBuilder(context)
|
||||
.setTitle(title)
|
||||
.setView(v)
|
||||
.setCancelable(false)
|
||||
.create()
|
||||
}
|
||||
|
||||
fun build(context: Context, title: Int, message: String?): AlertDialog {
|
||||
return build(context, context.getString(title), message)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun build(context: Context, title: Int, message: Int): AlertDialog {
|
||||
return build(context, title, context.getString(message))
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<vector android:height="24dp" android:tint="?attr/colorControlNormal"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- search icon -->
|
||||
<path android:fillColor="@android:color/white"
|
||||
android:pathData="M20.71,19.29l-3.89,-3.89C17.54,14.21 18,13.16 18,12c0,-3.31 -2.69,-6 -6,-6s-6,2.69 -6,6s2.69,6 6,6c1.16,0 2.21,-0.46 2.99,-1.2l3.89,3.89c0.39,0.39 1.02,0.39 1.41,0l0,0c0.39,-0.39 0.39,-1.02 0,-1.41zM8,12c0,-2.21 1.79,-4 4,-4s4,1.79 4,4s-1.79,4 -4,4S8,14.21 8,12z"/>
|
||||
</vector>
|
@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Copyright (c) 2023 to present Androidacy and contributors. Names, logos, icons, and the Androidacy name are all trademarks of Androidacy and may not be used without license. See LICENSE for more information.
|
||||
-->
|
||||
|
||||
<!-- This is the background for the search bar in the main screen. it should look like a floating action button when the search bar is not focused, and like a text field when it is. -->
|
||||
<!-- Path: app\src\main\res\drawable\search_bar_background.xml -->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:alpha="0.12" android:color="?attr/colorOnSurface" android:state_activated="true" android:state_focused="true" android:state_hovered="true" android:state_pressed="true" android:state_selected="true" android:state_window_focused="true" />
|
||||
<item android:alpha="0.12" android:color="?attr/colorOnSurface" android:state_activated="true" android:state_focused="true" android:state_hovered="true" android:state_pressed="true" android:state_selected="true" />
|
||||
<item android:alpha="0.12" android:color="?attr/colorOnSurface" android:state_activated="true" android:state_focused="true" android:state_hovered="true" android:state_pressed="true" />
|
||||
<item android:alpha="0.12" android:color="?attr/colorOnSurface" android:state_activated="true" android:state_focused="true" android:state_hovered="true" />
|
||||
<item android:alpha="0.12" android:color="?attr/colorOnSurface" android:state_activated="true" android:state_focused="true" />
|
||||
<item android:alpha="0.12" android:color="?attr/colorOnSurface" android:state_activated="true" />
|
||||
<item android:alpha="0.12" android:color="?attr/colorOnSurface" />
|
||||
</selector>
|
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/system_accent1_100"/>
|
||||
<corners android:radius="20dp"/>
|
||||
<padding android:left="0dp"
|
||||
android:bottom="0dp"
|
||||
android:right="0dp"
|
||||
android:top="0dp"/>
|
||||
</shape>
|
@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Copyright (c) 2023 to present Androidacy and contributors. Names, logos, icons, and the Androidacy name are all trademarks of Androidacy and may not be used without license. See LICENSE for more information.
|
||||
-->
|
||||
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/bottom_nav_menu">
|
||||
<!-- two options: "Installed" and "Online" -->
|
||||
<item
|
||||
android:id="@+id/back"
|
||||
android:icon="@drawable/ic_baseline_extension_24"
|
||||
android:title="@string/modules"
|
||||
app:showAsAction="ifRoom" />
|
||||
<item
|
||||
android:id="@+id/settings_menu_item"
|
||||
android:icon="@drawable/ic_baseline_settings_24"
|
||||
android:title="@string/action_settings"
|
||||
app:showAsAction="ifRoom" />
|
||||
</menu>
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 28 KiB |