mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-01-31 22:42:45 +01:00
Add build date to version info (#1114)
This commit is contained in:
parent
d1cd497a23
commit
e2ba265048
@ -21,9 +21,12 @@ android {
|
|||||||
versionCode 81
|
versionCode 81
|
||||||
versionName "0.24.3"
|
versionName "0.24.3"
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
resValue "string", "app_name", "Wulkanowy"
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
|
|
||||||
|
resValue "string", "app_name", "Wulkanowy"
|
||||||
|
buildConfigField "long", "BUILD_TIMESTAMP", String.valueOf(System.currentTimeMillis())
|
||||||
|
|
||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
firebase_enabled: project.hasProperty("enableFirebase")
|
firebase_enabled: project.hasProperty("enableFirebase")
|
||||||
]
|
]
|
||||||
|
@ -18,6 +18,18 @@
|
|||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
<data android:scheme="https" />
|
<data android:scheme="https" />
|
||||||
</intent>
|
</intent>
|
||||||
|
<intent>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<data android:scheme="mailto" />
|
||||||
|
</intent>
|
||||||
|
<intent>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<data android:scheme="tel" />
|
||||||
|
</intent>
|
||||||
|
<intent>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<data android:scheme="geo" />
|
||||||
|
</intent>
|
||||||
</queries>
|
</queries>
|
||||||
|
|
||||||
<application
|
<application
|
||||||
|
@ -57,7 +57,7 @@ class ErrorDialog : BaseDialogFragment<DialogErrorBinding>() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
||||||
return DialogErrorBinding.inflate(inflater).apply { binding = this }.root
|
return DialogErrorBinding.inflate(inflater).apply { binding = this }.root
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,11 +114,17 @@ class ErrorDialog : BaseDialogFragment<DialogErrorBinding>() {
|
|||||||
chooserTitle = getString(R.string.about_feedback),
|
chooserTitle = getString(R.string.about_feedback),
|
||||||
email = "wulkanowyinc@gmail.com",
|
email = "wulkanowyinc@gmail.com",
|
||||||
subject = "Zgłoszenie błędu",
|
subject = "Zgłoszenie błędu",
|
||||||
body = requireContext().getString(R.string.about_feedback_template,
|
body = requireContext().getString(
|
||||||
"${appInfo.systemManufacturer} ${appInfo.systemModel}", appInfo.systemVersion.toString(), appInfo.versionName
|
R.string.about_feedback_template,
|
||||||
|
"${appInfo.systemManufacturer} ${appInfo.systemModel}",
|
||||||
|
appInfo.systemVersion.toString(),
|
||||||
|
"${appInfo.versionName}-${appInfo.buildFlavor}"
|
||||||
) + "\n" + content,
|
) + "\n" + content,
|
||||||
onActivityNotFound = {
|
onActivityNotFound = {
|
||||||
requireContext().openInternetBrowser("https://github.com/wulkanowy/wulkanowy/issues", ::showMessage)
|
requireContext().openInternetBrowser(
|
||||||
|
"https://github.com/wulkanowy/wulkanowy/issues",
|
||||||
|
::showMessage
|
||||||
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,8 @@ import io.github.wulkanowy.utils.getCompatDrawable
|
|||||||
import io.github.wulkanowy.utils.openAppInMarket
|
import io.github.wulkanowy.utils.openAppInMarket
|
||||||
import io.github.wulkanowy.utils.openEmailClient
|
import io.github.wulkanowy.utils.openEmailClient
|
||||||
import io.github.wulkanowy.utils.openInternetBrowser
|
import io.github.wulkanowy.utils.openInternetBrowser
|
||||||
|
import io.github.wulkanowy.utils.toFormattedString
|
||||||
|
import io.github.wulkanowy.utils.toLocalDateTime
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
@ -35,7 +37,9 @@ class AboutFragment : BaseFragment<FragmentAboutBinding>(R.layout.fragment_about
|
|||||||
|
|
||||||
override val versionRes: Triple<String, String, Drawable?>?
|
override val versionRes: Triple<String, String, Drawable?>?
|
||||||
get() = context?.run {
|
get() = context?.run {
|
||||||
Triple(getString(R.string.about_version), "${appInfo.versionName} (${appInfo.versionCode})", getCompatDrawable(R.drawable.ic_all_about))
|
val buildTimestamp = appInfo.buildTimestamp.toLocalDateTime().toFormattedString("yyyy-MM-dd")
|
||||||
|
val versionSignature = "${appInfo.versionName}-${appInfo.buildFlavor} (${appInfo.versionCode}), $buildTimestamp"
|
||||||
|
Triple(getString(R.string.about_version), versionSignature, getCompatDrawable(R.drawable.ic_all_about))
|
||||||
}
|
}
|
||||||
|
|
||||||
override val creatorsRes: Triple<String, String, Drawable?>?
|
override val creatorsRes: Triple<String, String, Drawable?>?
|
||||||
@ -135,11 +139,17 @@ class AboutFragment : BaseFragment<FragmentAboutBinding>(R.layout.fragment_about
|
|||||||
chooserTitle = getString(R.string.about_feedback),
|
chooserTitle = getString(R.string.about_feedback),
|
||||||
email = "wulkanowyinc@gmail.com",
|
email = "wulkanowyinc@gmail.com",
|
||||||
subject = "Zgłoszenie błędu",
|
subject = "Zgłoszenie błędu",
|
||||||
body = getString(R.string.about_feedback_template,
|
body = getString(
|
||||||
"${appInfo.systemManufacturer} ${appInfo.systemModel}", appInfo.systemVersion.toString(), appInfo.versionName
|
R.string.about_feedback_template,
|
||||||
|
"${appInfo.systemManufacturer} ${appInfo.systemModel}",
|
||||||
|
appInfo.systemVersion.toString(),
|
||||||
|
"${appInfo.versionName}-${appInfo.buildFlavor}"
|
||||||
),
|
),
|
||||||
onActivityNotFound = {
|
onActivityNotFound = {
|
||||||
requireContext().openInternetBrowser("https://github.com/wulkanowy/wulkanowy/issues", ::showMessage)
|
requireContext().openInternetBrowser(
|
||||||
|
"https://github.com/wulkanowy/wulkanowy/issues",
|
||||||
|
::showMessage
|
||||||
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,9 @@ import android.content.res.Resources
|
|||||||
import android.os.Build.MANUFACTURER
|
import android.os.Build.MANUFACTURER
|
||||||
import android.os.Build.MODEL
|
import android.os.Build.MODEL
|
||||||
import android.os.Build.VERSION.SDK_INT
|
import android.os.Build.VERSION.SDK_INT
|
||||||
|
import io.github.wulkanowy.BuildConfig.BUILD_TIMESTAMP
|
||||||
import io.github.wulkanowy.BuildConfig.DEBUG
|
import io.github.wulkanowy.BuildConfig.DEBUG
|
||||||
|
import io.github.wulkanowy.BuildConfig.FLAVOR
|
||||||
import io.github.wulkanowy.BuildConfig.VERSION_CODE
|
import io.github.wulkanowy.BuildConfig.VERSION_CODE
|
||||||
import io.github.wulkanowy.BuildConfig.VERSION_NAME
|
import io.github.wulkanowy.BuildConfig.VERSION_NAME
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
@ -17,6 +19,10 @@ open class AppInfo @Inject constructor() {
|
|||||||
|
|
||||||
open val versionCode get() = VERSION_CODE
|
open val versionCode get() = VERSION_CODE
|
||||||
|
|
||||||
|
open val buildTimestamp get() = BUILD_TIMESTAMP
|
||||||
|
|
||||||
|
open val buildFlavor get() = FLAVOR
|
||||||
|
|
||||||
open val versionName get() = VERSION_NAME
|
open val versionName get() = VERSION_NAME
|
||||||
|
|
||||||
open val systemVersion get() = SDK_INT
|
open val systemVersion get() = SDK_INT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user