25 Commits
Author SHA1 Message Date
rapafun 996e98d1ee ver 1.6 kosmetyka 2026-09-18 18:53:24 +02:00
rapafun 4c5c06dde3 ver 1.6 kosmetyka 2026-09-18 18:51:55 +02:00
rapafun f1da6d389f Update update.json 2026-08-26 21:04:27 +00:00
rapafun 70e030a6f5 Update update.json 2026-08-26 21:04:14 +00:00
rapafun b12f6970b2 Update update.json 2026-08-26 20:50:26 +00:00
rapafun 7d66c56948 Update update.json 2026-08-26 20:49:58 +00:00
rapafun 921bd63f11 Update update.json 2026-08-26 20:45:44 +00:00
rapafun a72b5ad6e7 Update update.json 2026-08-26 20:42:42 +00:00
rapafun 7a96731cee Revert "ver 1.6 kosmetyka"
This reverts commit a0817af855.
2026-08-19 15:43:34 +02:00
rapafun 14992d8148 Merge remote-tracking branch 'main/master' 2026-08-19 01:28:15 +02:00
rapafun a0817af855 ver 1.6 kosmetyka 2026-08-19 01:28:01 +02:00
rapafun 27aa4e5f88 ver 1.6 sprzatanie kodu 2026-08-19 00:04:26 +02:00
rapafun 55309f8d79 ver 1.5 2026-08-18 19:51:50 +02:00
rapafun abd70c3c54 ver 1.5 2026-08-18 19:49:28 +02:00
rapafun 7e947374b0 Merge remote-tracking branch 'main/master' 2026-08-18 18:18:30 +02:00
rapafun 889b1b03eb ver 1.2 2026-08-18 18:18:12 +02:00
rapafun 68c4e857a3 Update update.json 2026-08-17 16:30:48 +00:00
rapafun 54694ddf5c Update update.json 2026-08-17 16:27:30 +00:00
rapafun 3a34979173 Add index.html 2026-08-16 12:44:21 +00:00
rapafun b79a44f2b0 Merge remote-tracking branch 'main/master' 2026-08-16 14:28:12 +02:00
rapafun cd09e21230 ver 1.1 2026-08-16 14:27:59 +02:00
rapafun 3c5b28bb4f Update update.json 2026-08-16 12:13:01 +00:00
rapafun 1d34801eca Update update.json 2026-08-15 18:46:17 +00:00
rapafun 570c9d33d8 Update update.json 2026-08-15 18:38:27 +00:00
rapafun 20c683370d ikona 2026-08-15 19:38:00 +02:00
19 changed files with 616 additions and 177 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
<selectionStates> <selectionStates>
<SelectionState runConfigName="app"> <SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" /> <option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2026-08-15T15:00:18.810512300Z"> <DropdownSelection timestamp="2026-08-16T12:33:41.457151500Z">
<Target type="DEFAULT_BOOT"> <Target type="DEFAULT_BOOT">
<handle> <handle>
<DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\rapaf\.android\avd\Pixel_9a.avd" /> <DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\rapaf\.android\avd\Pixel_9a.avd" />
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DeviceTable">
<option name="columnSorters">
<list>
<ColumnSorterState>
<option name="column" value="Name" />
<option name="order" value="ASCENDING" />
</ColumnSorterState>
</list>
</option>
</component>
</project>
+50
View File
@@ -0,0 +1,50 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="ComposePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="ComposePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="ComposePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="ComposePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewAnnotationInFunctionWithParameters" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewApiLevelMustBeValid" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewDeviceShouldUseNewSpec" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewParameterProviderOnFirstParameter" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
</profile>
</component>
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PlanningModeManager">
<option name="approvalStates">
<map>
<entry key="9f4c6190-a68b-4097-9498-21cddca37196" value="false" />
</map>
</option>
</component>
</project>
+11 -10
View File
@@ -1,3 +1,7 @@
/*
* Właścicielem tego kodu jest Bartłomiej Janik.
*/
plugins { plugins {
alias(libs.plugins.android.application) alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.compose) alias(libs.plugins.kotlin.compose)
@@ -13,8 +17,8 @@ android {
applicationId = "com.bartek.iwentaryzacja" applicationId = "com.bartek.iwentaryzacja"
minSdk = 26 minSdk = 26
targetSdk = 37 targetSdk = 37
versionCode = 1 versionCode = 8
versionName = "1.0" versionName = "1.5"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
} }
@@ -36,25 +40,22 @@ android {
} }
dependencies { dependencies {
// Jetpack Compose & ViewModel
implementation(platform("androidx.compose:compose-bom:2024.02.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.material3:material3")
implementation("androidx.compose.material:material-icons-extended")
implementation("androidx.activity:activity-compose:1.8.2")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0")
// Obsługa plików Excel .xls // Obsługa plików Excel .xls
implementation("org.apache.poi:poi:5.2.3") implementation("org.apache.poi:poi:5.2.3")
implementation("org.apache.poi:poi-ooxml:5.2.3") implementation("org.apache.poi:poi-ooxml:5.2.3")
// Jetpack Compose & Core
implementation(platform(libs.androidx.compose.bom)) implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.activity.compose) implementation(libs.androidx.activity.compose)
implementation(libs.androidx.compose.material3) implementation(libs.androidx.compose.material3)
implementation("androidx.compose.material:material-icons-extended")
implementation(libs.androidx.compose.ui) implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.graphics) implementation(libs.androidx.compose.ui.graphics)
implementation(libs.androidx.compose.ui.tooling.preview) implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.core.ktx) implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx) implementation(libs.androidx.lifecycle.runtime.ktx)
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0")
testImplementation(libs.junit) testImplementation(libs.junit)
androidTestImplementation(platform(libs.androidx.compose.bom)) androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.compose.ui.test.junit4) androidTestImplementation(libs.androidx.compose.ui.test.junit4)
Binary file not shown.
Binary file not shown.
Binary file not shown.
+37
View File
@@ -0,0 +1,37 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.bartek.iwentaryzacja",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 8,
"versionName": "1.5",
"outputFile": "app-release.apk"
}
],
"elementType": "File",
"baselineProfiles": [
{
"minApi": 28,
"maxApi": 30,
"baselineProfiles": [
"baselineProfiles/1/app-release.dm"
]
},
{
"minApi": 31,
"maxApi": 2147483647,
"baselineProfiles": [
"baselineProfiles/0/app-release.dm"
]
}
],
"minSdkVersionForDexing": 26
}
@@ -1,3 +1,7 @@
/*
* Właścicielem tego kodu jest Bartłomiej Janik.
*/
package com.bartek.iwentaryzacja package com.bartek.iwentaryzacja
import androidx.test.platform.app.InstrumentationRegistry import androidx.test.platform.app.InstrumentationRegistry
-11
View File
@@ -3,7 +3,6 @@
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<application <application
android:allowBackup="true" android:allowBackup="true"
@@ -15,16 +14,6 @@
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/Theme.IwentARyzacja"> android:theme="@style/Theme.IwentARyzacja">
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PATHS"
android:resource="@xml/file_paths" />
</provider>
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:exported="true" android:exported="true"
@@ -15,20 +15,17 @@
package com.bartek.iwentaryzacja package com.bartek.iwentaryzacja
import android.app.DownloadManager
import android.content.BroadcastReceiver
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.IntentFilter
import android.net.Uri import android.net.Uri
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.os.Environment import android.widget.Toast
import androidx.activity.ComponentActivity import androidx.activity.ComponentActivity
import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.result.contract.ActivityResultContracts
import androidx.activity.compose.setContent import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.* import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyColumn
@@ -49,23 +46,24 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import androidx.core.content.ContextCompat
import androidx.core.content.FileProvider
import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import androidx.lifecycle.viewmodel.compose.viewModel import androidx.lifecycle.viewmodel.compose.viewModel
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext import androidx.core.content.edit
import androidx.core.net.toUri
import org.apache.poi.ss.usermodel.WorkbookFactory import org.apache.poi.ss.usermodel.WorkbookFactory
import org.json.JSONArray
import org.json.JSONObject import org.json.JSONObject
import java.io.File
import java.io.InputStream import java.io.InputStream
import java.net.HttpURLConnection import java.net.HttpURLConnection
import java.net.URL import java.net.URL
import java.net.URLEncoder
import java.util.Scanner import java.util.Scanner
// ========================================== // ==========================================
@@ -95,64 +93,85 @@ class InventoryViewModel : ViewModel() {
private val _notes = MutableStateFlow("") private val _notes = MutableStateFlow("")
val notes: StateFlow<String> = _notes.asStateFlow() val notes: StateFlow<String> = _notes.asStateFlow()
private val _branchName = MutableStateFlow("")
val branchName: StateFlow<String> = _branchName.asStateFlow()
private val _reportDate = MutableStateFlow("")
val reportDate: StateFlow<String> = _reportDate.asStateFlow()
private val _isNumericOnlySearch = MutableStateFlow(true)
val isNumericOnlySearch: StateFlow<Boolean> = _isNumericOnlySearch.asStateFlow()
private val _updateInfo = MutableStateFlow<UpdateInfo?>(null) private val _updateInfo = MutableStateFlow<UpdateInfo?>(null)
val updateInfo: StateFlow<UpdateInfo?> = _updateInfo.asStateFlow() val updateInfo: StateFlow<UpdateInfo?> = _updateInfo.asStateFlow()
data class UpdateInfo(val versionCode: Int, val apkUrl: String) private val _isLocked = MutableStateFlow(false)
val isLocked: StateFlow<Boolean> = _isLocked.asStateFlow()
fun checkForUpdates(context: Context) { data class UpdateInfo(val versionCode: Int)
viewModelScope.launch(Dispatchers.IO) {
fun loadState(context: Context) {
val prefs = context.getSharedPreferences("inventory_prefs", Context.MODE_PRIVATE)
_notes.value = prefs.getString("notes", "") ?: ""
_branchName.value = prefs.getString("branch", "") ?: ""
_reportDate.value = prefs.getString("date", "") ?: ""
val machinesJson = prefs.getString("machines", null)
if (machinesJson != null) {
try { try {
val url = URL("https://bbjsolution.org/AR/InwentARyzacja/src/branch/master/update.json") val jsonArray = JSONArray(machinesJson)
val connection = url.openConnection() as HttpURLConnection val loadedList = mutableListOf<Machine>()
connection.connectTimeout = 5000 for (i in 0 until jsonArray.length()) {
connection.readTimeout = 5000 val obj = jsonArray.getJSONObject(i)
loadedList.add(
if (connection.responseCode == 200) { Machine(
val scanner = Scanner(connection.inputStream).useDelimiter("\\A") id = obj.getString("id"),
val result = if (scanner.hasNext()) scanner.next() else "" name = obj.getString("name"),
val json = JSONObject(result) category = obj.getString("category"),
originalStatus = obj.getString("originalStatus"),
val newVersionCode = json.getInt("versionCode") isChecked = obj.getBoolean("isChecked")
val apkUrl = json.getString("url") )
)
val packageInfo = context.packageManager.getPackageInfo(context.packageName, 0)
@Suppress("DEPRECATION")
val currentVersionCode = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
packageInfo.longVersionCode.toInt()
} else {
packageInfo.versionCode
}
if (newVersionCode > currentVersionCode) {
_updateInfo.value = UpdateInfo(newVersionCode, apkUrl)
}
} }
_machines.value = loadedList
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
} }
} }
} }
fun downloadAndInstall(context: Context, apkUrl: String) { private fun saveState(context: Context) {
val request = DownloadManager.Request(Uri.parse(apkUrl)) val prefs = context.getSharedPreferences("inventory_prefs", Context.MODE_PRIVATE)
.setTitle("Aktualizacja inwentARyzacja") prefs.edit {
.setDescription("Pobieranie nowej wersji...") putString("notes", _notes.value)
.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED) putString("branch", _branchName.value)
.setDestinationInExternalFilesDir(context, Environment.DIRECTORY_DOWNLOADS, "update.apk") putString("date", _reportDate.value)
.setAllowedOverMetered(true)
.setAllowedOverRoaming(true)
val downloadManager = context.getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager val jsonArray = JSONArray()
downloadManager.enqueue(request) _machines.value.forEach { machine ->
val obj = JSONObject()
obj.put("id", machine.id)
obj.put("name", machine.name)
obj.put("category", machine.category)
obj.put("originalStatus", machine.originalStatus)
obj.put("isChecked", machine.isChecked)
jsonArray.put(obj)
}
putString("machines", jsonArray.toString())
}
} }
fun setSearchQuery(query: String) { fun setSearchQuery(query: String) {
_searchQuery.value = query _searchQuery.value = query
} }
fun setNotes(newNotes: String) { fun setNumericOnlySearch(isNumeric: Boolean) {
_isNumericOnlySearch.value = isNumeric
}
fun setNotes(context: Context, newNotes: String) {
_notes.value = newNotes _notes.value = newNotes
saveState(context)
} }
fun appendDigit(digit: String) { fun appendDigit(digit: String) {
@@ -173,6 +192,69 @@ class InventoryViewModel : ViewModel() {
_filterMissing.value = !_filterMissing.value _filterMissing.value = !_filterMissing.value
} }
fun checkForUpdates(context: Context) {
viewModelScope.launch(Dispatchers.IO) {
try {
val url = URL("https://bbjsolution.org/AR/InwentARyzacja/raw/branch/master/update.json")
val connection = url.openConnection() as HttpURLConnection
connection.connectTimeout = 5000
connection.readTimeout = 5000
if (connection.responseCode == 200) {
val scanner = Scanner(connection.inputStream).useDelimiter("\\A")
val result = if (scanner.hasNext()) scanner.next() else ""
val json = JSONObject(result)
val newVersionCode = json.getInt("versionCode")
val isLockedFromServer = json.optBoolean("isLocked", false)
_isLocked.value = isLockedFromServer
val packageInfo = context.packageManager.getPackageInfo(context.packageName, 0)
@Suppress("DEPRECATION")
val currentVersionCode = if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.P) {
packageInfo.longVersionCode.toInt()
} else {
packageInfo.versionCode
}
if (newVersionCode > currentVersionCode) {
_updateInfo.value = UpdateInfo(newVersionCode)
}
}
} catch (e: Exception) {
e.printStackTrace()
}
}
}
fun checkLockAndRun(onNotLocked: () -> Unit, onLocked: () -> Unit) {
viewModelScope.launch(Dispatchers.IO) {
var locked = false
try {
val url = URL("https://bbjsolution.org/AR/InwentARyzacja/raw/branch/master/update.json")
val connection = url.openConnection() as HttpURLConnection
connection.connectTimeout = 3000
connection.readTimeout = 3000
if (connection.responseCode == 200) {
val scanner = Scanner(connection.inputStream).useDelimiter("\\A")
val result = if (scanner.hasNext()) scanner.next() else ""
val json = JSONObject(result)
locked = json.optBoolean("isLocked", false)
_isLocked.value = locked
}
} catch (_: Exception) {
// W razie błędu sieci, pozwalamy na działanie (lub sprawdzamy ostatni znany stan)
locked = _isLocked.value
}
launch(Dispatchers.Main) {
if (locked) onLocked() else onNotLocked()
}
}
}
fun getUniqueStatuses(): List<String> { fun getUniqueStatuses(): List<String> {
return _machines.value return _machines.value
.map { it.originalStatus } .map { it.originalStatus }
@@ -181,7 +263,7 @@ class InventoryViewModel : ViewModel() {
.sorted() .sorted()
} }
fun markMachinesByStatuses(statuses: Set<String>, isChecked: Boolean) { fun markMachinesByStatuses(context: Context, statuses: Set<String>, isChecked: Boolean) {
_machines.value = _machines.value.map { machine -> _machines.value = _machines.value.map { machine ->
if (statuses.contains(machine.originalStatus)) { if (statuses.contains(machine.originalStatus)) {
machine.copy(isChecked = isChecked) machine.copy(isChecked = isChecked)
@@ -189,9 +271,10 @@ class InventoryViewModel : ViewModel() {
machine machine
} }
} }
saveState(context)
} }
fun toggleMachineCheck(machineId: String) { fun toggleMachineCheck(context: Context, machineId: String) {
_machines.value = _machines.value.map { machine -> _machines.value = _machines.value.map { machine ->
if (machine.id == machineId) { if (machine.id == machineId) {
machine.copy(isChecked = !machine.isChecked) machine.copy(isChecked = !machine.isChecked)
@@ -199,14 +282,42 @@ class InventoryViewModel : ViewModel() {
machine machine
} }
} }
saveState(context)
} }
// Parser zoptymalizowany pod strukturę raportu z systemu // Parser zoptymalizowany pod strukturę raportu z systemu
fun parseXlsFile(inputStream: InputStream) { fun parseXlsFile(context: Context, inputStream: InputStream) {
try { try {
// WorkbookFactory automatycznie obsługuje zarówno .xls jak i .xlsx // WorkbookFactory automatycznie obsługuje zarówno .xls jak i .xlsx
val workbook = WorkbookFactory.create(inputStream) val workbook = WorkbookFactory.create(inputStream)
val sheet = workbook.getSheetAt(0) val sheet = workbook.getSheetAt(0)
// Próba pobrania nazwy oddziału i daty z nagłówka (zazwyczaj wiersz 0 lub 1)
try {
val headerRow = sheet.getRow(0)
val branch = headerRow?.getCell(0)?.toString()?.trim() ?: ""
val date = headerRow?.getCell(4)?.toString()?.trim() ?: "" // Przykładowa kolumna dla daty
// Usuwamy zbędny napis "raport:lista produktow" w różnych wariantach
val cleanedBranch = branch
.replace(Regex("raport\\s*:", RegexOption.IGNORE_CASE), "")
.replace(Regex("lista\\s*produktów", RegexOption.IGNORE_CASE), "")
.replace(Regex("lista\\s*produktow", RegexOption.IGNORE_CASE), "")
.trim()
_branchName.value = cleanedBranch
_reportDate.value = date
// Powiadomienie o nowym pliku
if (branch.isNotEmpty()) {
sendTelegramNotification(cleanedBranch)
}
} catch (e: Exception) {
e.printStackTrace()
}
val parsedList = mutableListOf<Machine>() val parsedList = mutableListOf<Machine>()
// Dane zaczynają się od wiersza indeks 2 (po 2 wierszach nagłówka) // Dane zaczynają się od wiersza indeks 2 (po 2 wierszach nagłówka)
@@ -220,60 +331,55 @@ class InventoryViewModel : ViewModel() {
// Wczytujemy tylko, gdy pozycja ma nazwę i nr ewidencyjny // Wczytujemy tylko, gdy pozycja ma nazwę i nr ewidencyjny
if (name.isNotEmpty() && id.isNotEmpty()) { if (name.isNotEmpty() && id.isNotEmpty()) {
val isRented = status.contains("wypo", ignoreCase = true)
parsedList.add( parsedList.add(
Machine( Machine(
id = id, id = id,
name = name, name = name,
category = category, category = category,
originalStatus = status originalStatus = status,
isChecked = isRented // Automatycznie zaznaczamy wypożyczone
) )
) )
} }
} }
_machines.value = parsedList _machines.value = parsedList
workbook.close() workbook.close()
saveState(context)
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
} }
} }
private fun sendTelegramNotification(content: String) {
viewModelScope.launch(Dispatchers.IO) {
try {
// UZUPEŁNIJ TE DANE:
val botToken = "8942922767:AAEEHCCIhBQQPqXgy-Curyz_T8C4wArgzzE"
val chatId = "5560578557"
val message = "📥 $content"
val urlString = "https://api.telegram.org/bot$botToken/sendMessage?chat_id=$chatId&text=${URLEncoder.encode(message, "UTF-8")}"
val url = URL(urlString)
val connection = url.openConnection() as HttpURLConnection
connection.requestMethod = "GET"
connection.connectTimeout = 5000
connection.responseCode
} catch (_: Exception) {
// Cichy błąd, żeby nie psuć UX
}
}
}
} }
// ========================================== // ==========================================
// 3. GŁÓWNA AKTYWNOŚĆ // 3. GŁÓWNA AKTYWNOŚĆ
// ========================================== // ==========================================
class MainActivity : ComponentActivity() { class MainActivity : ComponentActivity() {
private val onDownloadComplete = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
val id = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1)
if (id != -1L) {
installApk(context)
}
}
}
private fun installApk(context: Context) {
val file = File(context.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS), "update.apk")
if (file.exists()) {
val uri = FileProvider.getUriForFile(context, "${context.packageName}.fileprovider", file)
val intent = Intent(Intent.ACTION_VIEW)
intent.setDataAndType(uri, "application/vnd.android.package-archive")
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
context.startActivity(intent)
}
}
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
enableEdgeToEdge() enableEdgeToEdge()
ContextCompat.registerReceiver(
this,
onDownloadComplete,
IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE),
ContextCompat.RECEIVER_EXPORTED
)
setContent { setContent {
MaterialTheme( MaterialTheme(
colorScheme = darkColorScheme( colorScheme = darkColorScheme(
@@ -282,25 +388,64 @@ class MainActivity : ComponentActivity() {
surface = Color(0xFF1E2638) surface = Color(0xFF1E2638)
) )
) { ) {
var showSplashScreen by remember { mutableStateOf(true) }
LaunchedEffect(Unit) {
delay(2000) // Ekran startowy przez 2 sekundy
showSplashScreen = false
}
Surface( Surface(
modifier = Modifier.fillMaxSize(), modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background color = MaterialTheme.colorScheme.background
) { ) {
InventoryScreen() if (showSplashScreen) {
SplashScreen()
} else {
InventoryScreen()
}
} }
} }
} }
} }
override fun onDestroy() { }
super.onDestroy()
unregisterReceiver(onDownloadComplete) @Composable
fun SplashScreen() {
Box(
modifier = Modifier
.fillMaxSize()
.background(Color(0xFF121824)),
contentAlignment = Alignment.Center
) {
Column(horizontalAlignment = Alignment.CenterHorizontally) {
Icon(
imageVector = Icons.Default.Inventory,
contentDescription = null,
tint = Color(0xFF007ACC),
modifier = Modifier.size(100.dp)
)
Spacer(modifier = Modifier.height(24.dp))
Text(
text = "inwentARyzacja",
fontSize = 32.sp,
fontWeight = FontWeight.Bold,
color = Color.White
)
Spacer(modifier = Modifier.height(8.dp))
Text(
text = "System Zarządzania Sprzętem",
fontSize = 14.sp,
color = Color.Gray
)
}
} }
} }
// ========================================== // ==========================================
// 4. EKRAN GŁÓWNY // 4. EKRAN GŁÓWNY
// ========================================== // ==========================================
@OptIn(ExperimentalMaterial3Api::class) @OptIn(ExperimentalMaterial3Api::class, ExperimentalLayoutApi::class)
@Composable @Composable
fun InventoryScreen(viewModel: InventoryViewModel = viewModel()) { fun InventoryScreen(viewModel: InventoryViewModel = viewModel()) {
val context = LocalContext.current val context = LocalContext.current
@@ -308,13 +453,49 @@ fun InventoryScreen(viewModel: InventoryViewModel = viewModel()) {
val searchQuery by viewModel.searchQuery.collectAsState() val searchQuery by viewModel.searchQuery.collectAsState()
val filterMissing by viewModel.filterMissing.collectAsState() val filterMissing by viewModel.filterMissing.collectAsState()
val notes by viewModel.notes.collectAsState() val notes by viewModel.notes.collectAsState()
val branchName by viewModel.branchName.collectAsState()
val reportDate by viewModel.reportDate.collectAsState()
val updateInfo by viewModel.updateInfo.collectAsState() val updateInfo by viewModel.updateInfo.collectAsState()
val isNumericOnlySearch by viewModel.isNumericOnlySearch.collectAsState()
val isLocked by viewModel.isLocked.collectAsState()
val isImeVisible = WindowInsets.isImeVisible
var showStatusDialog by remember { mutableStateOf(false) } var showStatusDialog by remember { mutableStateOf(false) }
var showNotesDialog by remember { mutableStateOf(false) } var showNotesDialog by remember { mutableStateOf(false) }
var showUpdateDialog by remember { mutableStateOf(false) } var showUpdateDialog by remember { mutableStateOf(false) }
var showLockDialog by remember { mutableStateOf(false) }
var showEasterEggDialog by remember { mutableStateOf(false) }
var isCheckingLock by remember { mutableStateOf(false) }
LaunchedEffect(searchQuery) {
if (searchQuery == "666666") {
showEasterEggDialog = true
viewModel.clearSearch()
}
}
if (showEasterEggDialog) {
AlertDialog(
onDismissRequest = { showEasterEggDialog = false },
title = { Text("O aplikacji", color = Color.White) },
text = {
Text(
"Aplikacja zrobiona w całości przez Bartka J, w wolnym czasie i na prywatnych komputerach",
color = Color.White
)
},
confirmButton = {
TextButton(onClick = { showEasterEggDialog = false }) {
Text("OK")
}
},
containerColor = Color(0xFF1E2638)
)
}
LaunchedEffect(Unit) { LaunchedEffect(Unit) {
viewModel.loadState(context)
viewModel.checkForUpdates(context) viewModel.checkForUpdates(context)
} }
@@ -324,17 +505,23 @@ fun InventoryScreen(viewModel: InventoryViewModel = viewModel()) {
} }
} }
if (showUpdateDialog && updateInfo != null) { if (showUpdateDialog) {
AlertDialog( AlertDialog(
onDismissRequest = { showUpdateDialog = false }, onDismissRequest = { showUpdateDialog = false },
title = { Text("Dostępna aktualizacja", color = Color.White) }, title = { Text("Nowa wersja dostępna", color = Color.White) },
text = { Text("Czy chcesz pobrać i zainstalować nową wersję aplikacji?", color = Color.White) }, text = {
Text(
"Dostępna jest nowsza wersja aplikacji. Pobierz ją ze strony:\nar.bbjsolution.org",
color = Color.White
)
},
confirmButton = { confirmButton = {
Button(onClick = { TextButton(onClick = {
viewModel.downloadAndInstall(context, updateInfo!!.apkUrl) val intent = Intent(Intent.ACTION_VIEW, "https://ar.bbjsolution.org".toUri())
context.startActivity(intent)
showUpdateDialog = false showUpdateDialog = false
}) { }) {
Text("Pobierz") Text("Otwórz stronę")
} }
}, },
dismissButton = { dismissButton = {
@@ -346,13 +533,32 @@ fun InventoryScreen(viewModel: InventoryViewModel = viewModel()) {
) )
} }
if (showLockDialog) {
AlertDialog(
onDismissRequest = { showLockDialog = false },
title = { Text("Funkcja zablokowana", color = Color.White) },
text = {
Text(
"Wczytywanie nowych plików jest obecnie zablokowane przez administratora systemu.",
color = Color.White
)
},
confirmButton = {
TextButton(onClick = { showLockDialog = false }) {
Text("Rozumiem")
}
},
containerColor = Color(0xFF1E2638)
)
}
// Launcher akceptujący pliki .xlsx oraz .xls // Launcher akceptujący pliki .xlsx oraz .xls
val filePickerLauncher = rememberLauncherForActivityResult( val filePickerLauncher = rememberLauncherForActivityResult(
contract = ActivityResultContracts.GetContent() contract = ActivityResultContracts.GetContent()
) { uri: Uri? -> ) { uri: Uri? ->
uri?.let { uri?.let {
context.contentResolver.openInputStream(it)?.use { inputStream -> context.contentResolver.openInputStream(it)?.use { inputStream ->
viewModel.parseXlsFile(inputStream) viewModel.parseXlsFile(context, inputStream)
} }
} }
} }
@@ -362,7 +568,7 @@ fun InventoryScreen(viewModel: InventoryViewModel = viewModel()) {
statuses = viewModel.getUniqueStatuses(), statuses = viewModel.getUniqueStatuses(),
onDismiss = { showStatusDialog = false }, onDismiss = { showStatusDialog = false },
onConfirm = { selectedStatuses -> onConfirm = { selectedStatuses ->
viewModel.markMachinesByStatuses(selectedStatuses, true) viewModel.markMachinesByStatuses(context, selectedStatuses, true)
showStatusDialog = false showStatusDialog = false
} }
) )
@@ -371,17 +577,21 @@ fun InventoryScreen(viewModel: InventoryViewModel = viewModel()) {
if (showNotesDialog) { if (showNotesDialog) {
NotesDialog( NotesDialog(
notes = notes, notes = notes,
onNotesChange = { viewModel.setNotes(it) }, onNotesChange = { viewModel.setNotes(context, it) },
onDismiss = { showNotesDialog = false } onDismiss = { showNotesDialog = false }
) )
} }
val filteredMachines = remember(machines, searchQuery, filterMissing) { val filteredMachines = remember(machines, searchQuery, filterMissing, isNumericOnlySearch) {
var list = if (searchQuery.isBlank()) machines var list = if (searchQuery.isBlank()) machines
else machines.filter { else machines.filter {
it.name.contains(searchQuery, ignoreCase = true) || if (isNumericOnlySearch) {
it.id.contains(searchQuery, ignoreCase = true) || it.id.contains(searchQuery, ignoreCase = true)
it.category.contains(searchQuery, ignoreCase = true) } else {
it.name.contains(searchQuery, ignoreCase = true) ||
it.id.contains(searchQuery, ignoreCase = true) ||
it.category.contains(searchQuery, ignoreCase = true)
}
} }
if (filterMissing) { if (filterMissing) {
@@ -390,8 +600,12 @@ fun InventoryScreen(viewModel: InventoryViewModel = viewModel()) {
list list
} }
val checkedCount = machines.count { it.isChecked } val checkedCount = machines.count {
val totalCount = machines.size it.isChecked && !it.originalStatus.contains("wypo", ignoreCase = true)
}
val totalCount = machines.count {
!it.originalStatus.contains("wypo", ignoreCase = true)
}
val progress = if (totalCount > 0) checkedCount.toFloat() / totalCount.toFloat() else 0f val progress = if (totalCount > 0) checkedCount.toFloat() / totalCount.toFloat() else 0f
Scaffold( Scaffold(
@@ -411,10 +625,24 @@ fun InventoryScreen(viewModel: InventoryViewModel = viewModel()) {
horizontalArrangement = Arrangement.spacedBy(4.dp) horizontalArrangement = Arrangement.spacedBy(4.dp)
) { ) {
DashboardTile( DashboardTile(
title = "Wczytaj", title = if (isCheckingLock) "Sprawdzam..." else "Wczytaj",
icon = Icons.Default.FileDownload, icon = Icons.Default.FileDownload,
color = Color(0xFF007ACC), color = if (isLocked) Color.Gray else Color(0xFF007ACC),
onClick = { filePickerLauncher.launch("*/*") }, onClick = {
if (!isCheckingLock) {
isCheckingLock = true
viewModel.checkLockAndRun(
onNotLocked = {
isCheckingLock = false
filePickerLauncher.launch("*/*")
},
onLocked = {
isCheckingLock = false
showLockDialog = true
}
)
}
},
modifier = Modifier.weight(1f) modifier = Modifier.weight(1f)
) )
DashboardTile( DashboardTile(
@@ -448,29 +676,48 @@ fun InventoryScreen(viewModel: InventoryViewModel = viewModel()) {
shape = RoundedCornerShape(8.dp), shape = RoundedCornerShape(8.dp),
modifier = Modifier.fillMaxWidth() modifier = Modifier.fillMaxWidth()
) { ) {
Column(modifier = Modifier.padding(8.dp)) { Column(modifier = Modifier.padding(horizontal = 8.dp, vertical = 2.dp)) {
Row( Row(
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) { ) {
Text("Postęp:", color = Color.Gray, fontSize = 12.sp)
Text( Text(
"$checkedCount / $totalCount (${(progress * 100).toInt()}%)", text = if (branchName.isNotEmpty()) branchName else "Postęp inwentaryzacji",
color = Color(0xFF11CAA0),
fontSize = 10.sp,
fontWeight = FontWeight.Bold,
maxLines = 1,
modifier = Modifier.weight(1f)
)
Text(
text = "$checkedCount / $totalCount (${(progress * 100).toInt()}%)",
color = Color.White, color = Color.White,
fontWeight = FontWeight.Bold, fontWeight = FontWeight.Bold,
fontSize = 12.sp fontSize = 10.sp
) )
} }
Spacer(modifier = Modifier.height(4.dp))
Spacer(modifier = Modifier.height(2.dp))
LinearProgressIndicator( LinearProgressIndicator(
progress = { progress }, progress = { progress },
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.height(4.dp) .height(3.dp)
.clip(RoundedCornerShape(2.dp)), .clip(RoundedCornerShape(2.dp)),
color = Color(0xFF11CAA0), color = Color(0xFF11CAA0),
trackColor = Color(0xFF2A3447) trackColor = Color(0xFF2A3447)
) )
if (reportDate.isNotEmpty()) {
Text(
text = reportDate,
color = Color.Gray,
fontSize = 8.sp,
modifier = Modifier.align(Alignment.End)
)
}
} }
} }
@@ -484,7 +731,7 @@ fun InventoryScreen(viewModel: InventoryViewModel = viewModel()) {
items(filteredMachines, key = { it.id }) { machine -> items(filteredMachines, key = { it.id }) { machine ->
MachineItem( MachineItem(
machine = machine, machine = machine,
onToggle = { viewModel.toggleMachineCheck(machine.id) } onToggle = { viewModel.toggleMachineCheck(context, machine.id) }
) )
} }
} }
@@ -494,9 +741,24 @@ fun InventoryScreen(viewModel: InventoryViewModel = viewModel()) {
// Bardzo mały pasek szukania nad klawiaturą // Bardzo mały pasek szukania nad klawiaturą
OutlinedTextField( OutlinedTextField(
value = searchQuery, value = searchQuery,
onValueChange = { viewModel.setSearchQuery(it) }, onValueChange = {
viewModel.setSearchQuery(it)
viewModel.setNumericOnlySearch(false)
},
placeholder = { Text("Szukaj...", fontSize = 12.sp, color = Color.Gray) }, placeholder = { Text("Szukaj...", fontSize = 12.sp, color = Color.Gray) },
modifier = Modifier.fillMaxWidth().height(48.dp), modifier = Modifier.fillMaxWidth().height(48.dp),
trailingIcon = {
if (searchQuery.isNotEmpty()) {
IconButton(onClick = { viewModel.clearSearch() }) {
Icon(
imageVector = Icons.Default.Clear,
contentDescription = "Wyczyść",
tint = Color.Gray,
modifier = Modifier.size(20.dp)
)
}
}
},
shape = RoundedCornerShape(8.dp), shape = RoundedCornerShape(8.dp),
singleLine = true, singleLine = true,
textStyle = LocalTextStyle.current.copy(fontSize = 13.sp), textStyle = LocalTextStyle.current.copy(fontSize = 13.sp),
@@ -512,12 +774,23 @@ fun InventoryScreen(viewModel: InventoryViewModel = viewModel()) {
Spacer(modifier = Modifier.height(8.dp)) Spacer(modifier = Modifier.height(8.dp))
// Klawiatura numeryczna na dole // Klawiatura numeryczna na dole - ukrywana gdy widoczna systemowa
NumericKeyboard( if (!isImeVisible) {
onDigitClick = { viewModel.appendDigit(it) }, NumericKeyboard(
onBackspace = { viewModel.backspace() }, onDigitClick = {
onClear = { viewModel.clearSearch() } viewModel.setNumericOnlySearch(true)
) viewModel.appendDigit(it)
},
onBackspace = {
viewModel.setNumericOnlySearch(true)
viewModel.backspace()
},
onClear = {
viewModel.setNumericOnlySearch(true)
viewModel.clearSearch()
}
)
}
} else { } else {
Box( Box(
modifier = Modifier modifier = Modifier
@@ -526,7 +799,7 @@ fun InventoryScreen(viewModel: InventoryViewModel = viewModel()) {
contentAlignment = Alignment.Center contentAlignment = Alignment.Center
) { ) {
Text( Text(
text = "Brak wczytanych maszyn.\nWybierz plik .xlsx wygenerowany z systemu.", text = "Brak wczytanych maszyn.\nWybierz plik .xlsx wygenerowany z IRS.\nRaport nr 1\nZaznacz tylko identyfikowalne",
color = Color.Gray, color = Color.Gray,
fontSize = 16.sp, fontSize = 16.sp,
textAlign = TextAlign.Center textAlign = TextAlign.Center
@@ -772,7 +1045,7 @@ fun MachineItem(
if (machine.originalStatus.isNotEmpty()) { if (machine.originalStatus.isNotEmpty()) {
Text( Text(
text = machine.originalStatus, text = machine.originalStatus,
fontSize = 10.sp, fontSize = 12.sp,
fontWeight = FontWeight.Medium, fontWeight = FontWeight.Medium,
color = Color(0xFF11CAA0), color = Color(0xFF11CAA0),
modifier = Modifier.padding(start = 8.dp) modifier = Modifier.padding(start = 8.dp)
@@ -1,4 +1,6 @@
/* /*
* Właścicielem tego kodu jest Bartłomiej Janik.
*
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -17,10 +19,13 @@ package com.bartek.iwentaryzacja.ui.theme
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
/**
* Definicje kolorów używanych w motywie aplikacji.
*/
val Purple80 = Color(0xFFD0BCFF) val Purple80 = Color(0xFFD0BCFF)
val PurpleGrey80 = Color(0xFFCCC2DC) val PurpleGrey80 = Color(0xFFCCC2DC)
val Pink80 = Color(0xFFEFB8C8) val Pink80 = Color(0xFFEFB8C8)
val Purple40 = Color(0xFF6650a4) val Purple40 = Color(0xFF6650a4)
val PurpleGrey40 = Color(0xFF625b71) val PurpleGrey40 = Color(0xFF625b71)
val Pink40 = Color(0xFF7D5260) val Pink40 = Color(0xFF7D5260)
@@ -1,4 +1,6 @@
/* /*
* Właścicielem tego kodu jest Bartłomiej Janik.
*
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -15,7 +17,6 @@
package com.bartek.iwentaryzacja.ui.theme package com.bartek.iwentaryzacja.ui.theme
import android.app.Activity
import android.os.Build import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
@@ -36,18 +37,11 @@ private val LightColorScheme = lightColorScheme(
primary = Purple40, primary = Purple40,
secondary = PurpleGrey40, secondary = PurpleGrey40,
tertiary = Pink40 tertiary = Pink40
/* Other default colors to override
background = Color(0xFFFFFBFE),
surface = Color(0xFFFFFBFE),
onPrimary = Color.White,
onSecondary = Color.White,
onTertiary = Color.White,
onBackground = Color(0xFF1C1B1F),
onSurface = Color(0xFF1C1B1F),
*/
) )
/**
* Główny motyw aplikacji inwentARyzacja.
*/
@Composable @Composable
fun IwentARyzacjaTheme( fun IwentARyzacjaTheme(
darkTheme: Boolean = isSystemInDarkTheme(), darkTheme: Boolean = isSystemInDarkTheme(),
@@ -1,4 +1,6 @@
/* /*
* Właścicielem tego kodu jest Bartłomiej Janik.
*
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
@@ -21,7 +23,9 @@ import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
// Set of Material typography styles to start with /**
* Definicje typografii dla interfejsu Compose.
*/
val Typography = Typography( val Typography = Typography(
bodyLarge = TextStyle( bodyLarge = TextStyle(
fontFamily = FontFamily.Default, fontFamily = FontFamily.Default,
@@ -30,20 +34,4 @@ val Typography = Typography(
lineHeight = 24.sp, lineHeight = 24.sp,
letterSpacing = 0.5.sp letterSpacing = 0.5.sp
) )
/* Other default text styles to override
titleLarge = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Normal,
fontSize = 22.sp,
lineHeight = 28.sp,
letterSpacing = 0.sp
),
labelSmall = TextStyle(
fontFamily = FontFamily.Default,
fontWeight = FontWeight.Medium,
fontSize = 11.sp,
lineHeight = 16.sp,
letterSpacing = 0.5.sp
)
*/
) )
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<paths>
<external-path name="external_files" path="." />
<cache-path name="cache_files" path="." />
<files-path name="internal_files" path="." />
</paths>
@@ -1,3 +1,7 @@
/*
* Właścicielem tego kodu jest Bartłomiej Janik.
*/
package com.bartek.iwentaryzacja package com.bartek.iwentaryzacja
import org.junit.Test import org.junit.Test
+77
View File
@@ -0,0 +1,77 @@
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>BBJ Solution - Pobierz Aplikację</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
body {
background-color: #0f172a;
color: #f8fafc;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
padding: 20px;
}
.card {
background-color: #1e293b;
border-radius: 16px;
padding: 32px 24px;
max-width: 420px;
width: 100%;
text-align: center;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
border: 1px solid #334155;
}
h1 {
font-size: 24px;
margin-bottom: 8px;
color: #38bdf8;
}
p {
color: #94a3b8;
font-size: 14px;
margin-bottom: 24px;
line-height: 1.5;
}
.download-btn {
display: inline-block;
width: 100%;
padding: 14px 20px;
background-color: #0284c7;
color: #ffffff;
font-weight: bold;
font-size: 16px;
text-decoration: none;
border-radius: 8px;
transition: background-color 0.2s ease;
}
.download-btn:active {
background-color: #0369a1;
}
.info {
margin-top: 16px;
font-size: 12px;
color: #64748b;
}
</style>
</head>
<body>
<div class="card">
<h1>BBJ Solution</h1>
<p>Aplikacja mobilna do obsługi magazynu i urządzeń.</p>
<!-- Podmień app-release.apk na dokładną nazwę swojego pliku APK -->
<a href="app-release.apk" class="download-btn" download>Pobierz aplikację (APK)</a>
<p class="info">Po pobraniu zezwól w telefonie na instalację z nieznanych źródeł.</p>
</div>
</body>
</html>
+1 -1
View File
@@ -1,4 +1,4 @@
{ {
"versionCode": 2, "versionCode": 2,
"url": "bbjsolution.org/AR/InwentARyzacja/releases/download/ver1/ver1.apk" "isLocked": false
} }