consolidate all repos to one for archive
15
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_first_app/.gitignore
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
3
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_first_app/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
1
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_first_app/.idea/.name
generated
Normal file
@@ -0,0 +1 @@
|
||||
My Application
|
117
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_first_app/.idea/codeStyles/Project.xml
generated
Normal file
@@ -0,0 +1,117 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<codeStyleSettings language="XML">
|
||||
<option name="FORCE_REARRANGE_MODE" value="1" />
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
<arrangement>
|
||||
<rules>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:android</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:id</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>style</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
</rules>
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
@@ -0,0 +1,5 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||
</state>
|
||||
</component>
|
6
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_first_app/.idea/compiler.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="1.7" />
|
||||
</component>
|
||||
</project>
|
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<targetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="QUICK_BOOT_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="VIRTUAL_DEVICE_PATH" />
|
||||
<value value="C:\Users\Nikola\.android\avd\Pixel4_3_API_30.avd" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</targetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2022-12-20T22:21:22.072699300Z" />
|
||||
</component>
|
||||
</project>
|
3
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_first_app/.idea/dictionaries/Nikola.xml
generated
Normal file
@@ -0,0 +1,3 @@
|
||||
<component name="ProjectDictionaryState">
|
||||
<dictionary name="Nikola" />
|
||||
</component>
|
21
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_first_app/.idea/gradle.xml
generated
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="jbr-17" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
<option value="$PROJECT_DIR$/lib" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
6
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_first_app/.idea/kotlinc.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="1.7.10" />
|
||||
</component>
|
||||
</project>
|
10
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_first_app/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
6
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_first_app/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
1
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_first_app/app/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
@@ -0,0 +1,52 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.example.myapplication'
|
||||
compileSdk 33
|
||||
|
||||
buildFeatures {
|
||||
viewBinding = true
|
||||
}
|
||||
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.myapplication"
|
||||
minSdk 21
|
||||
targetSdk 33
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'org.apache.commons:commons-io:1.3.2'
|
||||
implementation 'com.google.code.gson:gson:2.10'
|
||||
implementation 'androidx.core:core-ktx:1.9.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.5.1'
|
||||
implementation 'com.google.android.material:material:1.7.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation project(path: ':lib')
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
implementation 'com.squareup.picasso:picasso:2.8'
|
||||
}
|
21
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_first_app/app/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
@@ -0,0 +1,24 @@
|
||||
package com.example.myapplication
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
assertEquals("com.example.myapplication", appContext.packageName)
|
||||
}
|
||||
}
|
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<application
|
||||
android:name=".MyApplication"
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.MyApplication"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".RecyclerViewActivity"
|
||||
android:exported="false">
|
||||
<meta-data
|
||||
android:name="android.app.lib_name"
|
||||
android:value="" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".SettingsActivity"
|
||||
android:exported="false">
|
||||
<meta-data
|
||||
android:name="android.app.lib_name"
|
||||
android:value="" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".AboutActivity"
|
||||
android:exported="false">
|
||||
<meta-data
|
||||
android:name="android.app.lib_name"
|
||||
android:value="" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ImputActivity"
|
||||
android:exported="false">
|
||||
<meta-data
|
||||
android:name="android.app.lib_name"
|
||||
android:value="" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
android:name="android.app.lib_name"
|
||||
android:value="" />
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
@@ -0,0 +1,32 @@
|
||||
package com.example.myapplication
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import com.example.myapplication.databinding.ActivityAboutBinding
|
||||
|
||||
class AboutActivity : AppCompatActivity() {
|
||||
|
||||
private lateinit var binding: ActivityAboutBinding
|
||||
lateinit var app: MyApplication
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityAboutBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
binding.back.setOnClickListener {
|
||||
finish()
|
||||
}
|
||||
|
||||
app = application as MyApplication
|
||||
|
||||
if(app.containsInSP(MyApplication.SPKey.ABOUTC)){
|
||||
var count = app.sharedPref.getInt(app.enumToString(MyApplication.SPKey.ABOUTC),0)
|
||||
count += 1
|
||||
app.saveToSP(MyApplication.SPKey.ABOUTC, count)
|
||||
}else{
|
||||
app.saveToSP(MyApplication.SPKey.ABOUTC, 1)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,102 @@
|
||||
package com.example.myapplication
|
||||
|
||||
import android.app.Activity
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import android.content.Intent
|
||||
import android.widget.Toast
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import com.example.lib.Library
|
||||
import com.example.myapplication.databinding.ActivityImputBinding
|
||||
|
||||
class ImputActivity : AppCompatActivity() {
|
||||
|
||||
private lateinit var binding: ActivityImputBinding
|
||||
|
||||
val getQRData = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
|
||||
if (result.resultCode == Activity.RESULT_OK) {
|
||||
val data: Intent? = result.data
|
||||
val str = data?.getStringExtra("SCAN_RESULT")
|
||||
if (str != null) {
|
||||
val values = str.split(",")
|
||||
try {
|
||||
if (values.isNotEmpty()) {
|
||||
binding.textName.setText(values[0])
|
||||
binding.textYear.setText(values[1])
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(this, "Unparsable QRCode", Toast.LENGTH_SHORT).show()
|
||||
binding.textYear.text.clear()
|
||||
binding.textName.text.clear()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lateinit var app: MyApplication
|
||||
var isUpdate = false
|
||||
var posit = 0
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityImputBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
app = application as MyApplication
|
||||
|
||||
if(intent.hasExtra("pos")){
|
||||
posit = intent.getIntExtra("pos", 0)
|
||||
binding.textName.setText(app.library.list[posit].name)
|
||||
binding.textYear.setText(app.library.list[posit].yearOfRelese.toString())
|
||||
isUpdate = true
|
||||
}
|
||||
if(app.containsInSP(MyApplication.SPKey.INPUTC)){
|
||||
var count = app.sharedPref.getInt(app.enumToString(MyApplication.SPKey.INPUTC),0)
|
||||
count += 1
|
||||
app.saveToSP(MyApplication.SPKey.INPUTC, count)
|
||||
}else{
|
||||
app.saveToSP(MyApplication.SPKey.INPUTC, 1)
|
||||
}
|
||||
|
||||
|
||||
binding.inputActivityAddButton.setOnClickListener {
|
||||
|
||||
if (binding.textName.text.isEmpty() &&
|
||||
binding.textYear.text.isEmpty()
|
||||
) {
|
||||
Toast.makeText(this, "Empty Fields", Toast.LENGTH_LONG).show()
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
val name = binding.textName.text.toString()
|
||||
val year = binding.textYear.text.toString().toInt()
|
||||
|
||||
if(!isUpdate){
|
||||
if(app.addBookWithSave(name, year)){
|
||||
finish()
|
||||
}else{
|
||||
Toast.makeText(this, "Year to low", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}else{
|
||||
app.library.list[posit].name = name
|
||||
app.library.list[posit].yearOfRelese = year
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
binding.inputActivityScanQRButton.setOnClickListener {
|
||||
try {
|
||||
val intent = Intent("com.google.zxing.client.android.SCAN")
|
||||
intent.putExtra("SCAN_MODE", "QR_CODE_MODE") // use “PRODUCT_MODE” for barcodes
|
||||
getQRData.launch(intent)
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(this, e.toString(), Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
|
||||
binding.inputActivityExitButton.setOnClickListener {
|
||||
setResult(RESULT_CANCELED)
|
||||
finish()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,71 @@
|
||||
package com.example.myapplication
|
||||
|
||||
import android.graphics.Color
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.cardview.widget.CardView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.example.lib.Library
|
||||
import com.squareup.picasso.Picasso
|
||||
|
||||
class ListViewAdapter(private var library: Library, private val onClickObject:ListViewAdapter.MyOnClick) : RecyclerView.Adapter<ListViewAdapter.ViewHolder>() {
|
||||
|
||||
class ViewHolder(ItemView: View): RecyclerView.ViewHolder(ItemView){
|
||||
val title: TextView = itemView.findViewById(R.id.title)
|
||||
val year: TextView = itemView.findViewById(R.id.year)
|
||||
val authur: TextView = itemView.findViewById(R.id.authur)
|
||||
val line:CardView = itemView.findViewById(R.id.rv_line)
|
||||
val img:ImageView = itemView.findViewById(R.id.imageView)
|
||||
}
|
||||
|
||||
interface MyOnClick {
|
||||
fun onLongClickListener(p0: View?, position:Int)
|
||||
fun onClickListener(p0: View?, position:Int)
|
||||
}
|
||||
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.recycler_view_item,parent,false)
|
||||
return ViewHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val ItemsViewModel = library.list[position]
|
||||
holder.title.text = ItemsViewModel.name
|
||||
holder.year.text = ItemsViewModel.yearOfRelese.toString()
|
||||
holder.authur.text = ItemsViewModel.authur.toString()
|
||||
|
||||
Picasso.get().load(R.drawable.treeimage)
|
||||
.placeholder(androidx.appcompat.R.drawable.abc_ic_clear_material)
|
||||
.error(com.google.android.material.R.drawable.mtrl_ic_error)
|
||||
.into(holder.img)
|
||||
|
||||
holder.line.setOnLongClickListener(object:View.OnLongClickListener{
|
||||
override fun onLongClick(v: View?): Boolean {
|
||||
onClickObject.onLongClickListener(v,holder.adapterPosition)
|
||||
notifyDataSetChanged()
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
holder.line.setOnClickListener (
|
||||
object: View.OnClickListener{
|
||||
override fun onClick(v: View?) {
|
||||
onClickObject.onClickListener(v,holder.adapterPosition)
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return library.list.size
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,80 @@
|
||||
package com.example.myapplication
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.widget.Toast
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import com.example.myapplication.databinding.ActivityMainBinding
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
|
||||
private lateinit var binding: ActivityMainBinding
|
||||
lateinit var app: MyApplication
|
||||
|
||||
|
||||
// val getImputActivityData = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
|
||||
// if (result.resultCode == Activity.RESULT_OK) {
|
||||
// val data = result.data
|
||||
// val name = data?.getStringExtra("Name")
|
||||
// val year = data?.getIntExtra("Year", 0)
|
||||
//
|
||||
// if (name != null && year != null) {
|
||||
// if (!app.add(name, year)) {
|
||||
// Toast.makeText(this, "Year to low", Toast.LENGTH_SHORT).show()
|
||||
// }
|
||||
// Log.i("haha", app.library.toString())
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
app = application as MyApplication
|
||||
|
||||
if(app.containsInSP(MyApplication.SPKey.MAINC)){
|
||||
var count = app.sharedPref.getInt(app.enumToString(MyApplication.SPKey.MAINC),0)
|
||||
count += 1
|
||||
app.saveToSP(MyApplication.SPKey.MAINC, count)
|
||||
}else{
|
||||
app.saveToSP(MyApplication.SPKey.MAINC, 1)
|
||||
}
|
||||
|
||||
binding = ActivityMainBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
binding.exitButton.setOnClickListener {
|
||||
finish()
|
||||
}
|
||||
|
||||
binding.infoButton.setOnClickListener {
|
||||
val intent = Intent(this, AboutActivity::class.java)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
binding.addButton.setOnClickListener {
|
||||
val intent = Intent(this, ImputActivity::class.java)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
binding.printButton.setOnClickListener {
|
||||
Log.i("haha", app.library.toString())
|
||||
}
|
||||
|
||||
binding.settingsButton.setOnClickListener {
|
||||
val intent = Intent(this, SettingsActivity::class.java)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
binding.listViewButton.setOnClickListener {
|
||||
val intent = Intent(this, RecyclerViewActivity::class.java)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,124 @@
|
||||
package com.example.myapplication
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.content.res.Configuration
|
||||
import android.content.res.Resources
|
||||
import android.util.Log
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.example.lib.Library
|
||||
import com.google.gson.Gson
|
||||
import java.io.File
|
||||
import org.apache.commons.io.FileUtils
|
||||
import java.io.IOException
|
||||
import java.util.*
|
||||
|
||||
const val MY_JSON_NAME = "mydata.json"
|
||||
const val MY_SP_FILE_NAME = "myshared.data"
|
||||
|
||||
class MyApplication : Application() {
|
||||
lateinit var library: Library
|
||||
|
||||
private lateinit var gson: Gson
|
||||
private lateinit var file: File
|
||||
lateinit var sharedPref: SharedPreferences
|
||||
|
||||
override fun onCreate( ) {
|
||||
super.onCreate()
|
||||
sharedPref = getSharedPreferences(MY_SP_FILE_NAME, Context.MODE_PRIVATE)
|
||||
|
||||
if (!containsInSP(SPKey.ID)) {
|
||||
saveToSP(SPKey.ID, UUID.randomUUID().toString().replace("-", ""))
|
||||
}
|
||||
if(containsInSP(SPKey.THEME)){
|
||||
setTheme(sharedPref.getBoolean(enumToString(SPKey.THEME), false))
|
||||
}
|
||||
if(containsInSP(SPKey.MYAPPC)){
|
||||
var count = sharedPref.getInt(enumToString(SPKey.MYAPPC),0)
|
||||
count += 1
|
||||
saveToSP(SPKey.MYAPPC, count)
|
||||
}else{
|
||||
saveToSP(SPKey.MYAPPC, 1)
|
||||
}
|
||||
|
||||
|
||||
|
||||
gson = Gson()
|
||||
file = File(filesDir, MY_JSON_NAME)
|
||||
LoadData()
|
||||
}
|
||||
|
||||
enum class SPKey{
|
||||
ID,
|
||||
THEME,
|
||||
LANG,
|
||||
MYAPPC,
|
||||
SETTINGSC,
|
||||
MAINC,
|
||||
ABOUTC,
|
||||
INPUTC
|
||||
}
|
||||
fun enumToString(key: SPKey):String{
|
||||
return when(key){
|
||||
SPKey.ID -> "ID"
|
||||
SPKey.THEME -> "THEME"
|
||||
SPKey.LANG -> "LANG"
|
||||
SPKey.MYAPPC -> "MYAPPC"
|
||||
SPKey.SETTINGSC -> "SETTINGSC"
|
||||
SPKey.MAINC -> "MAINC"
|
||||
SPKey.ABOUTC -> "ABOUTC"
|
||||
SPKey.INPUTC -> "INPUTC"
|
||||
}
|
||||
}
|
||||
fun setTheme(darkMode: Boolean){
|
||||
if (darkMode){
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
|
||||
}else{
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
|
||||
}
|
||||
saveToSP(SPKey.THEME,darkMode)
|
||||
}
|
||||
fun saveToSP(key:SPKey, value: String) {
|
||||
with (sharedPref.edit()) {
|
||||
putString(enumToString(key), value)
|
||||
apply()
|
||||
}
|
||||
}
|
||||
fun saveToSP(key:SPKey, value: Int) {
|
||||
with (sharedPref.edit()) {
|
||||
putInt(enumToString(key), value)
|
||||
apply()
|
||||
}
|
||||
}
|
||||
fun saveToSP(key:SPKey, value: Boolean) {
|
||||
with (sharedPref.edit()) {
|
||||
putBoolean(enumToString(key), value)
|
||||
apply()
|
||||
}
|
||||
}
|
||||
fun containsInSP(key: SPKey):Boolean {
|
||||
return sharedPref.contains(enumToString(key))
|
||||
}
|
||||
fun addBookWithSave(name: String, year: Int): Boolean{
|
||||
val res = library.addBook(name,year)
|
||||
saveToFile()
|
||||
return res
|
||||
}
|
||||
fun saveToFile() {
|
||||
try {
|
||||
FileUtils.writeStringToFile(file, gson.toJson(library))
|
||||
} catch (e: IOException) {
|
||||
Log.i("haha", e.toString())
|
||||
}
|
||||
}
|
||||
fun LoadData() {
|
||||
library = try {
|
||||
gson.fromJson(FileUtils.readFileToString(file), Library::class.java)
|
||||
}catch (e:Exception){
|
||||
Log.i("haha", e.toString())
|
||||
Library("Library")
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,68 @@
|
||||
package com.example.myapplication
|
||||
|
||||
import android.content.Intent
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.example.myapplication.databinding.ActivityRecyclerViewBinding
|
||||
|
||||
|
||||
class RecyclerViewActivity : AppCompatActivity() {
|
||||
|
||||
lateinit var app: MyApplication
|
||||
private lateinit var binding: ActivityRecyclerViewBinding
|
||||
private lateinit var adapter: ListViewAdapter
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
app = application as MyApplication
|
||||
binding = ActivityRecyclerViewBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
binding.itemView.layoutManager = LinearLayoutManager(this)
|
||||
|
||||
adapter = ListViewAdapter(app.library, object : ListViewAdapter.MyOnClick {
|
||||
override fun onLongClickListener(p0: View?, pos: Int) {
|
||||
//Timber.d("Here code comes ${pos}.")
|
||||
val builder = AlertDialog.Builder(this@RecyclerViewActivity) //access context from inner class
|
||||
//set title for alert dialog
|
||||
builder.setTitle("Delete")
|
||||
builder.setMessage(app.library.list[pos].toString())
|
||||
builder.setIcon(android.R.drawable.ic_dialog_alert)
|
||||
builder.setPositiveButton("Yes") { dialogInterface, which -> //performing positive action
|
||||
Toast.makeText(applicationContext, "clicked yes", Toast.LENGTH_LONG).show()
|
||||
app.library.list.removeAt(pos)
|
||||
adapter.notifyDataSetChanged()
|
||||
app.saveToFile()
|
||||
}
|
||||
builder.setNeutralButton("Cancel") { dialogInterface, which -> //performing cancel action
|
||||
Toast.makeText(applicationContext, "clicked cancel\n operation cancel", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
builder.setNegativeButton("No") { dialogInterface, which -> //performing negative action
|
||||
Toast.makeText(applicationContext, "clicked No", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
// Create the AlertDialog
|
||||
val alertDialog: AlertDialog = builder.create()
|
||||
alertDialog.setCancelable(false)
|
||||
alertDialog.show()
|
||||
}
|
||||
|
||||
override fun onClickListener(p0: View?, position: Int) {
|
||||
val intent = Intent(this@RecyclerViewActivity, ImputActivity::class.java)
|
||||
intent.putExtra("pos", position)
|
||||
adapter.notifyDataSetChanged()
|
||||
startActivity(intent)
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
binding.itemView.adapter = adapter
|
||||
|
||||
binding.exitButton.setOnClickListener {
|
||||
finish()
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,65 @@
|
||||
package com.example.myapplication
|
||||
|
||||
import android.os.Bundle
|
||||
import android.util.DisplayMetrics
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.example.myapplication.databinding.ActivitySettingsBinding
|
||||
import java.util.*
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
|
||||
class SettingsActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivitySettingsBinding
|
||||
|
||||
lateinit var app: MyApplication
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivitySettingsBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
app = application as MyApplication
|
||||
|
||||
if(app.containsInSP(MyApplication.SPKey.SETTINGSC)){
|
||||
var count = app.sharedPref.getInt(app.enumToString(MyApplication.SPKey.SETTINGSC),0)
|
||||
count += 1
|
||||
app.saveToSP(MyApplication.SPKey.SETTINGSC, count)
|
||||
}else{
|
||||
app.saveToSP(MyApplication.SPKey.SETTINGSC, 1)
|
||||
}
|
||||
|
||||
if(app.containsInSP(MyApplication.SPKey.LANG)){
|
||||
binding.textView.text = app.sharedPref.getString(app.enumToString(MyApplication.SPKey.LANG), "")
|
||||
}
|
||||
|
||||
binding.exitButton.setOnClickListener {
|
||||
finish()
|
||||
}
|
||||
|
||||
binding.slovenianButton.setOnClickListener {
|
||||
app.saveToSP(MyApplication.SPKey.LANG, "sl")
|
||||
binding.textView.text = "sl"
|
||||
}
|
||||
|
||||
|
||||
binding.englishButton.setOnClickListener {
|
||||
app.saveToSP(MyApplication.SPKey.LANG, "en-us")
|
||||
binding.textView.text = "en-us"
|
||||
}
|
||||
|
||||
binding.germanButton.setOnClickListener {
|
||||
app.saveToSP(MyApplication.SPKey.LANG, "ksh")
|
||||
binding.textView.text = "ksh"
|
||||
}
|
||||
|
||||
binding.darkmodeButton.setOnClickListener {
|
||||
app.setTheme(true)
|
||||
}
|
||||
|
||||
binding.lightmodeButton.setOnClickListener {
|
||||
app.setTheme(false)
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="#212121"/>
|
||||
<corners android:radius="30dp"/>
|
||||
</shape>
|
@@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M476.35,247.98l-85.33,-74.67c-3.14,-2.73 -7.62,-3.39 -11.44,-1.68c-3.82,1.73 -6.25,5.53 -6.25,9.71v32H256c-5.89,0 -10.67,4.78 -10.67,10.67v64c0,5.89 4.78,10.67 10.67,10.67h117.33v32c0,4.18 2.45,7.98 6.25,9.71c1.41,0.64 2.92,0.96 4.42,0.96c2.54,0 5.03,-0.9 7.02,-2.64l85.33,-74.67c2.33,-2.03 3.65,-4.95 3.65,-8.02S478.68,250.01 476.35,247.98z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M341.33,320H256c-17.64,0 -32,-14.36 -32,-32v-64c0,-17.64 14.36,-32 32,-32h85.33c5.89,0 10.67,-4.78 10.67,-10.67V32c0,-17.64 -14.36,-32 -32,-32H64C46.36,0 32,14.36 32,32v448c0,17.64 14.36,32 32,32h256c17.64,0 32,-14.36 32,-32V330.67C352,324.78 347.22,320 341.33,320z"/>
|
||||
</vector>
|
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
@@ -0,0 +1,16 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="32dp"
|
||||
android:width="32dp"
|
||||
android:viewportHeight="330"
|
||||
android:viewportWidth="330">
|
||||
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M165,0.01C74.02,0.01 0,74.02 0,165c0,90.98 74.02,164.99 165,164.99s165,-74.01 165,-164.99C330,74.02 255.98,0.01 165,0.01zM165,299.99c-74.44,0 -135,-60.56 -135,-134.99S90.56,30.01 165,30.01s135,60.56 135,134.99C300,239.44 239.44,299.99 165,299.99z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M165,130.01c-8.28,0 -15,6.72 -15,15v99.98c0,8.28 6.72,15 15,15s15,-6.72 15,-15v-99.98C180,136.73 173.28,130.01 165,130.01z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M165,70.01c-3.95,0 -7.81,1.6 -10.61,4.39c-2.79,2.79 -4.39,6.66 -4.39,10.61s1.6,7.81 4.39,10.61c2.79,2.79 6.66,4.39 10.61,4.39s7.81,-1.6 10.61,-4.39c2.79,-2.8 4.39,-6.66 4.39,-10.61s-1.6,-7.82 -4.39,-10.61C172.81,71.61 168.95,70.01 165,70.01z"/>
|
||||
</vector>
|
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="32dp"
|
||||
android:width="32dp"
|
||||
android:viewportHeight="15"
|
||||
android:viewportWidth="15">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:fillType="evenOdd" android:pathData="M6.5,1C6.224,1 6,1.224 6,1.5C6,1.776 6.224,2 6.5,2C7.127,2 7.457,2.2 7.656,2.478C7.878,2.79 8,3.288 8,4V11C8,11.712 7.878,12.21 7.656,12.522C7.457,12.8 7.127,13 6.5,13C6.224,13 6,13.224 6,13.5C6,13.776 6.224,14 6.5,14C7.373,14 8.043,13.7 8.469,13.103C8.48,13.089 8.49,13.074 8.5,13.059C8.51,13.074 8.52,13.089 8.531,13.103C8.957,13.7 9.627,14 10.5,14C10.776,14 11,13.776 11,13.5C11,13.224 10.776,13 10.5,13C9.873,13 9.543,12.8 9.344,12.522C9.122,12.21 9,11.712 9,11V4C9,3.288 9.122,2.79 9.344,2.478C9.543,2.2 9.873,2 10.5,2C10.776,2 11,1.776 11,1.5C11,1.224 10.776,1 10.5,1C9.627,1 8.957,1.3 8.531,1.897C8.52,1.911 8.51,1.926 8.5,1.941C8.49,1.926 8.48,1.911 8.469,1.897C8.043,1.3 7.373,1 6.5,1ZM14,5H11V4H14C14.552,4 15,4.448 15,5V10C15,10.552 14.552,11 14,11H11V10H14V5ZM6,4V5H1L1,10H6V11H1C0.448,11 0,10.552 0,10V5C0,4.448 0.448,4 1,4H6Z"/>
|
||||
</vector>
|
After Width: | Height: | Size: 43 KiB |
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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=".AboutActivity">
|
||||
|
||||
<Button
|
||||
android:id="@+id/back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/mar3"
|
||||
android:text="@string/back_Button"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/appName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="@string/app_name"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/appDescription"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/app_description"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/appName" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/appVersion"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/app_version"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/appDescription" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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=".ImputActivity">
|
||||
|
||||
<Button
|
||||
android:id="@+id/inputActivity_addButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/add_Button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.498"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textYear" />
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/inputActivity_scanQRButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="@string/scan_QR_Button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/inputActivity_addButton" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/textName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:ems="10"
|
||||
android:hint="@string/input_Name"
|
||||
android:textColorHint="#757575"
|
||||
android:inputType="textPersonName"
|
||||
android:minHeight="48dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:autofillHints="" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/textYear"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:ems="10"
|
||||
android:hint="@string/input_year"
|
||||
android:inputType="number"
|
||||
android:minHeight="48dp"
|
||||
android:textColorHint="#757575"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textName"
|
||||
android:autofillHints="" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/inputActivity_exit_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="@string/cancel_Button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/inputActivity_scanQRButton" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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=".MainActivity">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/image_Description"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/treeimage" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/exitButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/mar1"
|
||||
android:background="@drawable/buttonstyle"
|
||||
android:text="@string/exit_Button"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/addButton" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/infoButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/buttonstyle"
|
||||
android:layout_marginEnd="@dimen/mar1"
|
||||
android:text="@string/info_Button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/addButton" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/addButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/buttonstyle"
|
||||
android:layout_marginTop="@dimen/mar1"
|
||||
android:text="@string/add_Button"
|
||||
app:layout_constraintEnd_toStartOf="@+id/infoButton"
|
||||
app:layout_constraintStart_toEndOf="@+id/exitButton"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView4" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/exitButton"
|
||||
app:layout_constraintStart_toStartOf="@+id/exitButton"
|
||||
app:layout_constraintTop_toBottomOf="@+id/exitButton"
|
||||
app:srcCompat="@drawable/exit_svg" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/addButton"
|
||||
app:layout_constraintStart_toStartOf="@+id/addButton"
|
||||
app:layout_constraintTop_toBottomOf="@+id/addButton"
|
||||
app:srcCompat="@drawable/input_svg" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintEnd_toEndOf="@+id/infoButton"
|
||||
app:layout_constraintStart_toStartOf="@+id/infoButton"
|
||||
app:layout_constraintTop_toBottomOf="@+id/infoButton"
|
||||
app:srcCompat="@drawable/info_svg" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/print_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/print"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView2" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/settings_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/mar3"
|
||||
android:layout_marginTop="@dimen/mar1"
|
||||
android:text="@string/settings"
|
||||
app:layout_constraintStart_toEndOf="@+id/print_button"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView3" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/list_view_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/mar1"
|
||||
android:layout_marginEnd="@dimen/mar1"
|
||||
android:text="ListView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView5" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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=".RecyclerViewActivity">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/itemView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/exit_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/mar1"
|
||||
android:text="@string/back_Button"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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=".SettingsActivity">
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/barrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="end"
|
||||
app:constraint_referenced_ids="slovenian_button,english_button,german_button"
|
||||
tools:layout_editor_absoluteX="122dp"
|
||||
tools:layout_editor_absoluteY="281dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/slovenian_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/mar1"
|
||||
android:layout_marginTop="@dimen/mar1"
|
||||
android:layout_marginEnd="@dimen/mar2"
|
||||
android:text="@string/slovenian_lang"
|
||||
app:layout_constraintEnd_toStartOf="@+id/barrier"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/english_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/mar1"
|
||||
android:layout_marginTop="@dimen/mar1"
|
||||
android:layout_marginEnd="@dimen/mar2"
|
||||
android:text="@string/english_lang"
|
||||
app:layout_constraintEnd_toStartOf="@+id/barrier"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/slovenian_button" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/german_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/mar1"
|
||||
android:layout_marginTop="@dimen/mar1"
|
||||
android:layout_marginEnd="@dimen/mar2"
|
||||
android:text="@string/german_lang"
|
||||
app:layout_constraintEnd_toStartOf="@+id/barrier"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/english_button" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/darkmode_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/mar2"
|
||||
android:layout_marginTop="@dimen/mar1"
|
||||
android:text="@string/dark_mode"
|
||||
app:layout_constraintStart_toEndOf="@+id/barrier"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/lightmode_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/mar1"
|
||||
android:layout_marginStart="@dimen/mar2"
|
||||
android:text="@string/light_mode"
|
||||
app:layout_constraintStart_toEndOf="@+id/barrier"
|
||||
app:layout_constraintTop_toBottomOf="@+id/darkmode_button" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/exit_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/mar1"
|
||||
android:text="@string/back_Button"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/mar1"
|
||||
android:layout_marginTop="@dimen/mar1"
|
||||
android:text="TextView"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/german_button" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:id="@+id/rv_line">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TextView" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/year"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TextView" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/authur"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TextView" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"/>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 982 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 7.6 KiB |
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">My Application G</string>
|
||||
<string name="app_description">App-Beschreibung</string>
|
||||
<string name="app_version">Ausfuhrung: 0.1</string>
|
||||
<string name="image_Description">Bild des Baumes</string>
|
||||
<string name="exit_Button">Ausgang</string>
|
||||
<string name="info_Button">uber</string>
|
||||
<string name="add_Button">Eingang</string>
|
||||
<string name="scan_QR_Button">QR scannen</string>
|
||||
<string name="back_Button">Der Rucken</string>
|
||||
<string name="input_year">Jahr</string>
|
||||
<string name="input_Name">Name</string>
|
||||
<string name="cancel_Button">Absagen</string>
|
||||
<string name="slovenian_lang">Slowenisch</string>
|
||||
<string name="english_lang">Englisch</string>
|
||||
<string name="german_lang">Deutsch</string>
|
||||
<string name="dark_mode">Dunkel</string>
|
||||
<string name="light_mode">Licht</string>
|
||||
<string name="print">Drucken</string>
|
||||
<string name="settings">Einstellungen</string>
|
||||
</resources>
|
@@ -0,0 +1,16 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.MyApplication" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/Secondary</item>
|
||||
<item name="colorPrimaryVariant">@color/Secondary_dark</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/Primary</item>
|
||||
<item name="colorSecondaryVariant">@color/Primary_dark</item>
|
||||
<item name="colorOnSecondary">@color/white</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">My Application S</string>
|
||||
<string name="app_description">Opis Aplikacije</string>
|
||||
<string name="app_version">Verzija: 0.1</string>
|
||||
<string name="image_Description">Slika drevesa</string>
|
||||
<string name="exit_Button">Izhod</string>
|
||||
<string name="info_Button">Info</string>
|
||||
<string name="add_Button">Vpis</string>
|
||||
<string name="scan_QR_Button">Skeniraj QR</string>
|
||||
<string name="back_Button">Nazaj</string>
|
||||
<string name="input_year">Leto</string>
|
||||
<string name="input_Name">Ime</string>
|
||||
<string name="cancel_Button">Prekini</string>
|
||||
<string name="slovenian_lang">Slovensko</string>
|
||||
<string name="english_lang">Anglesko</string>
|
||||
<string name="german_lang">Nemsko</string>
|
||||
<string name="dark_mode">Temni</string>
|
||||
<string name="light_mode">Svetli</string>
|
||||
<string name="print">Print</string>
|
||||
<string name="settings">Nastavitve</string>
|
||||
</resources>
|
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="Primary">#0a2463</color>
|
||||
<color name="Primary_light">#434b91</color>
|
||||
<color name="Primary_dark">#000038</color>
|
||||
<color name="Secondary">#f9323f</color>
|
||||
<color name="Secondary_light">#ff6d6a</color>
|
||||
<color name="Secondary_dark">#be0018</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#ffffff</color>
|
||||
</resources>
|
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="mar1">16dp</dimen>
|
||||
<dimen name="mar2">8dp</dimen>
|
||||
<dimen name="mar3">32dp</dimen>
|
||||
</resources>
|
@@ -0,0 +1,21 @@
|
||||
<resources>
|
||||
<string name="app_name">My Application E</string>
|
||||
<string name="app_description">App Description</string>
|
||||
<string name="app_version">Version: 0.1</string>
|
||||
<string name="image_Description">Image of tree</string>
|
||||
<string name="exit_Button">Exit</string>
|
||||
<string name="info_Button">About</string>
|
||||
<string name="add_Button">Input</string>
|
||||
<string name="scan_QR_Button">Scan QR</string>
|
||||
<string name="back_Button">Back</string>
|
||||
<string name="input_year">Year</string>
|
||||
<string name="input_Name">Name</string>
|
||||
<string name="cancel_Button">Cancel</string>
|
||||
<string name="slovenian_lang">Slovenian</string>
|
||||
<string name="english_lang">English</string>
|
||||
<string name="german_lang">German</string>
|
||||
<string name="dark_mode">Dark</string>
|
||||
<string name="light_mode">Light</string>
|
||||
<string name="print">Print</string>
|
||||
<string name="settings">Settings</string>
|
||||
</resources>
|
@@ -0,0 +1,17 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.MyApplication" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/Secondary</item>
|
||||
<item name="colorPrimaryVariant">@color/Secondary_light</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/Primary</item>
|
||||
<item name="colorSecondaryVariant">@color/Primary_light</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="android:fontFamily">@font/jet_brains_mono_regular</item>
|
||||
</style>
|
||||
</resources>
|
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample backup rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/guide/topics/data/autobackup
|
||||
for details.
|
||||
Note: This file is ignored for devices older that API 31
|
||||
See https://developer.android.com/about/versions/12/backup-restore
|
||||
-->
|
||||
<full-backup-content>
|
||||
<!--
|
||||
<include domain="sharedpref" path="."/>
|
||||
<exclude domain="sharedpref" path="device.xml"/>
|
||||
-->
|
||||
</full-backup-content>
|
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample data extraction rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
|
||||
for details.
|
||||
-->
|
||||
<data-extraction-rules>
|
||||
<cloud-backup>
|
||||
<!-- TODO: Use <include> and <exclude> to control what is backed up.
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
-->
|
||||
</cloud-backup>
|
||||
<!--
|
||||
<device-transfer>
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
</device-transfer>
|
||||
-->
|
||||
</data-extraction-rules>
|
@@ -0,0 +1,17 @@
|
||||
package com.example.myapplication
|
||||
|
||||
import org.junit.Test
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
class ExampleUnitTest {
|
||||
@Test
|
||||
fun addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2)
|
||||
}
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
id 'com.android.application' version '8.1.1' apply false
|
||||
id 'com.android.library' version '8.1.1' apply false
|
||||
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.7.10' apply false
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
# Project-wide Gradle settings.
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
# For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||
# Android operating system, and which are packaged with your app's APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
android.useAndroidX=true
|
||||
# Kotlin code style for this project: "official" or "obsolete":
|
||||
kotlin.code.style=official
|
||||
# Enables namespacing of each library's R class so that its R class includes only the
|
||||
# resources declared in the library itself and none from the library's dependencies,
|
||||
# thereby reducing the size of the R class for that library
|
||||
android.nonTransitiveRClass=true
|
||||
android.defaults.buildfeatures.buildconfig=true
|
||||
android.nonFinalResIds=false
|
BIN
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_first_app/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
#Thu Oct 13 13:10:22 CEST 2022
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
185
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_first_app/gradlew
vendored
Normal file
@@ -0,0 +1,185 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
exec "$JAVACMD" "$@"
|
89
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_first_app/gradlew.bat
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
1
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_first_app/lib/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
@@ -0,0 +1,13 @@
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id 'org.jetbrains.kotlin.jvm'
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_7
|
||||
targetCompatibility = JavaVersion.VERSION_1_7
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "io.github.serpro69:kotlin-faker:1.11.0"
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
package com.example.lib
|
||||
|
||||
class Authur(
|
||||
private val name: String,
|
||||
private val yearOfBerth: Int
|
||||
) {
|
||||
override fun toString(): String {
|
||||
return ("$name $yearOfBerth")
|
||||
}
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
package com.example.lib
|
||||
|
||||
import java.util.UUID
|
||||
|
||||
open class Book(
|
||||
var name: String,
|
||||
var yearOfRelese: Int,
|
||||
var authur: Authur,
|
||||
val id: String = UUID.randomUUID().toString().replace("-", "")
|
||||
|
||||
) : Comparable<Book> {
|
||||
|
||||
init {
|
||||
//if (yearOfRelese < 1200) throw YearToLow(yearOfRelese.toString())
|
||||
}
|
||||
|
||||
override fun compareTo(other: Book): Int {
|
||||
return this.yearOfRelese - other.yearOfRelese
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return ("B $name; $yearOfRelese; $authur; $id \n")
|
||||
}
|
||||
}
|
@@ -0,0 +1,106 @@
|
||||
package com.example.lib
|
||||
|
||||
import io.github.serpro69.kfaker.faker
|
||||
|
||||
class Library(private val name: String) : Sizable {
|
||||
|
||||
var list = mutableListOf<Book>()
|
||||
|
||||
override fun size(): Int {
|
||||
return list.size
|
||||
}
|
||||
|
||||
fun addBook(book: Book) {
|
||||
list.add(book)
|
||||
}
|
||||
|
||||
fun addBook(name: String, year: Int): Boolean {
|
||||
try {
|
||||
val aut = Authur("NikolaPetrov", 1956)
|
||||
list.add(Book(name, year, aut))
|
||||
} catch (e: YearToLow) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
fun sort() {
|
||||
list.sort()
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
var ret = "$name \n"
|
||||
ret += list.size.toString() + "\n"
|
||||
list.forEach {
|
||||
ret += it.toString()
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
fun averageAge(): Int {
|
||||
var ret = 0
|
||||
for (i in list) {
|
||||
ret += 2022 - i.yearOfRelese
|
||||
}
|
||||
ret /= list.size
|
||||
return ret
|
||||
}
|
||||
|
||||
fun filter(filterWord: String, include: Boolean): MutableList<Book> {
|
||||
val retList = mutableListOf<Book>()
|
||||
list.forEach {
|
||||
if (include) {
|
||||
if (it.name.contains(filterWord)) retList.add(it)
|
||||
} else {
|
||||
if (!it.name.contains(filterWord)) retList.add(it)
|
||||
}
|
||||
}
|
||||
return retList
|
||||
}
|
||||
|
||||
fun filterCount(filterWord: String): Int {
|
||||
var retInt: Int = 0
|
||||
list.forEach {
|
||||
if (it.name.contains(filterWord)) retInt++
|
||||
}
|
||||
return retInt
|
||||
}
|
||||
|
||||
fun longerThenFive(): MutableList<Book> {
|
||||
val retList = mutableListOf<Book>()
|
||||
|
||||
list.forEach {
|
||||
if (it.name.length > 5) retList.add(it)
|
||||
if (retList.size == 10) return retList
|
||||
}
|
||||
|
||||
return retList
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
fun generator(n: Int, lib: Library) {
|
||||
val fak = faker { }
|
||||
for (i in 1..n) {
|
||||
try {
|
||||
val pick: Int = (1..2).random()
|
||||
if (pick == 1) {
|
||||
val aut = Authur(fak.name.name(), 1956)
|
||||
val bok = Book(fak.book.title(), fak.random.nextInt(1000, 2000), aut)
|
||||
lib.addBook(bok)
|
||||
} else {
|
||||
val aut = Authur(fak.name.name(), 1956)
|
||||
val pBok = PictureBook(fak.book.title(), fak.random.nextInt(1000, 2000), aut, fak.random.nextInt(5, 22))
|
||||
lib.addBook(pBok)
|
||||
}
|
||||
} catch (e: YearToLow) {
|
||||
println(e.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,29 @@
|
||||
package com.example.lib
|
||||
|
||||
import io.github.serpro69.kfaker.faker
|
||||
|
||||
|
||||
fun main() {
|
||||
val librr = Library("Library")
|
||||
Library.generator(100, librr)
|
||||
|
||||
println(librr.averageAge())
|
||||
|
||||
println(librr.filterCount("The"))
|
||||
|
||||
var list = librr.filter("The", true)
|
||||
println(list.toString())
|
||||
|
||||
list = librr.filter("The", false)
|
||||
println(list.toString())
|
||||
|
||||
list = librr.longerThenFive()
|
||||
println(list.toString())
|
||||
|
||||
|
||||
/*
|
||||
librr.sort()
|
||||
println(librr.size())
|
||||
println(librr.toString())
|
||||
*/
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
package com.example.lib
|
||||
|
||||
class PictureBook(
|
||||
name: String,
|
||||
yearOfRelese: Int,
|
||||
authur: Authur,
|
||||
val numOfImg: Int
|
||||
|
||||
) : Book(
|
||||
name,
|
||||
yearOfRelese,
|
||||
authur
|
||||
) {
|
||||
|
||||
|
||||
override fun toString(): String {
|
||||
return ("P $name; $yearOfRelese; $numOfImg; $authur; $id \n")
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
package com.example.lib
|
||||
|
||||
class YearToLow(private val y: String) : Exception(y) {
|
||||
override fun toString(): String {
|
||||
return "Year to low $y"
|
||||
}
|
||||
}
|
||||
|
||||
interface Sizable {
|
||||
fun size(): Int
|
||||
}
|
||||
|
@@ -0,0 +1,17 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
rootProject.name = "My Application"
|
||||
include ':app'
|
||||
include ':lib'
|
15
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_second_app/.gitignore
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
3
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_second_app/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
1
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_second_app/.idea/.name
generated
Normal file
@@ -0,0 +1 @@
|
||||
MySecondApp
|
6
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_second_app/.idea/compiler.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="1.7" />
|
||||
</component>
|
||||
</project>
|
21
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_second_app/.idea/gradle.xml
generated
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="jbr-17" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
<option value="$PROJECT_DIR$/lib" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
6
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_second_app/.idea/kotlinc.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="1.7.10" />
|
||||
</component>
|
||||
</project>
|
10
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_second_app/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
6
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_second_app/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@@ -0,0 +1,8 @@
|
||||
# Prevozi
|
||||
|
||||
|
||||
# Povzetek :clipboard:
|
||||
|
||||
Aplikacija umogoca:
|
||||
* upogled nad ponudniki in njihovimi odhodi in in casom odhoda
|
||||
* Iskalec lahko postavi zeljeno pot
|
1
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_second_app/app/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/build
|
@@ -0,0 +1,54 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.example.mysecondapp'
|
||||
compileSdk 33
|
||||
|
||||
buildFeatures {
|
||||
viewBinding = true
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.mysecondapp"
|
||||
minSdk 26
|
||||
targetSdk 33
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation 'androidx.core:core-ktx:1.9.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.5.1'
|
||||
implementation 'com.google.android.material:material:1.7.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'org.osmdroid:osmdroid-android:6.1.11'
|
||||
implementation 'com.google.code.gson:gson:2.10'
|
||||
implementation 'org.apache.commons:commons-io:1.3.2'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
implementation project(path: ':lib')
|
||||
|
||||
|
||||
}
|
21
semester_3/uvod_v_platformno_odvisen_razvoj_aplikacij/my_second_app/app/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
@@ -0,0 +1,24 @@
|
||||
package com.example.mysecondapp
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
assertEquals("com.example.mysecondapp", appContext.packageName)
|
||||
}
|
||||
}
|
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||
tools:ignore="ScopedStorage" />
|
||||
<application
|
||||
android:name=".MyApplication"
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.MySecondApp"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".MapActivity"
|
||||
android:exported="false">
|
||||
<meta-data
|
||||
android:name="android.app.lib_name"
|
||||
android:value="" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
android:name="android.app.lib_name"
|
||||
android:value="AIzaSyCU2V43lqqB9O_XRHdc67ZQM0uQKVP2f4w" />
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
@@ -0,0 +1,85 @@
|
||||
package com.example.mysecondapp
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
||||
import com.example.mysecondapp.databinding.FragmentInputBinding
|
||||
import java.time.LocalDate
|
||||
|
||||
class InputFragment(var activity: MainActivity) : Fragment() {
|
||||
lateinit var binding: FragmentInputBinding
|
||||
|
||||
fun clearText(){
|
||||
binding.editName.text.clear()
|
||||
binding.editStartLocation.text.clear()
|
||||
binding.editEndLocation.text.clear()
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
binding = FragmentInputBinding.inflate(inflater, container, false)
|
||||
|
||||
if(activity.app.editEl){
|
||||
binding.button.text = R.string.buttonChange.toString()
|
||||
binding.button.setOnClickListener {
|
||||
|
||||
if (binding.editName.text.isEmpty() ||
|
||||
binding.editStartLocation.text.isEmpty() ||
|
||||
binding.editEndLocation.text.isEmpty()
|
||||
) return@setOnClickListener
|
||||
|
||||
activity.app.prevozi.list[activity.app.selectedEl].driverName = binding.editName.text.toString()
|
||||
activity.app.prevozi.list[activity.app.selectedEl].startLocation = binding.editStartLocation.text.toString()
|
||||
activity.app.prevozi.list[activity.app.selectedEl].endLocation = binding.editEndLocation.text.toString()
|
||||
|
||||
clearText()
|
||||
|
||||
activity.changeToList()
|
||||
}
|
||||
}else{
|
||||
binding.button.setOnClickListener {
|
||||
if (binding.editName.text.isEmpty() ||
|
||||
binding.editStartLocation.text.isEmpty() ||
|
||||
binding.editEndLocation.text.isEmpty()
|
||||
) return@setOnClickListener
|
||||
|
||||
activity.app.prevozi.add(
|
||||
binding.editName.text.toString(),
|
||||
binding.editStartLocation.text.toString(),
|
||||
binding.editEndLocation.text.toString(),
|
||||
LocalDate.now().plusDays(5),
|
||||
0.0,0.0
|
||||
)
|
||||
|
||||
clearText()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
if(activity.app.editEl){
|
||||
binding.button.text = "CHANGE"
|
||||
}else {
|
||||
binding.button.text = "ENTER"
|
||||
}
|
||||
//clearText()
|
||||
binding.editName.text.clear()
|
||||
binding.editStartLocation.setText("")
|
||||
binding.editEndLocation.setText("")
|
||||
if(activity.app.editEl){
|
||||
binding.editName.setText(activity.app.prevozi.list[activity.app.selectedEl].driverName)
|
||||
binding.editStartLocation.setText(activity.app.prevozi.list[activity.app.selectedEl].startLocation)
|
||||
binding.editEndLocation.setText(activity.app.prevozi.list[activity.app.selectedEl].endLocation)
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,58 @@
|
||||
package com.example.mysecondapp
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.cardview.widget.CardView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.example.lib.Prevozi
|
||||
|
||||
class ListViewAdapter(private val prevozi: Prevozi, private val myInterface: ListViewAdapter.MyOnClick) : RecyclerView.Adapter<ListViewAdapter.ViewHolder>() {
|
||||
|
||||
class ViewHolder(ItemView: View): RecyclerView.ViewHolder(ItemView){
|
||||
val name: TextView = itemView.findViewById(R.id.textDriverName)
|
||||
val sLocation: TextView = itemView.findViewById(R.id.textStartLocation)
|
||||
val eLocation: TextView = itemView.findViewById(R.id.textEndLocation)
|
||||
val sTime: TextView = itemView.findViewById(R.id.textStartTime)
|
||||
val line: CardView = itemView.findViewById(R.id.rv_line)
|
||||
}
|
||||
|
||||
interface MyOnClick {
|
||||
fun onLongClickListener(p0: View?, position:Int)
|
||||
fun onClickListener(p0: View?, position:Int)
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.fragment_list_view_item, parent,false)
|
||||
return ViewHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val ItemsViewModel = prevozi.list[position]
|
||||
holder.name.text = ItemsViewModel.driverName
|
||||
holder.sLocation.text = ItemsViewModel.startLocation
|
||||
holder.eLocation.text = ItemsViewModel.endLocation
|
||||
holder.sTime.text = ItemsViewModel.startTime.toString()
|
||||
|
||||
|
||||
holder.line.setOnLongClickListener(object:View.OnLongClickListener{
|
||||
override fun onLongClick(v: View?): Boolean {
|
||||
myInterface.onLongClickListener(v,holder.adapterPosition)
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
||||
holder.line.setOnClickListener (
|
||||
object: View.OnClickListener{
|
||||
override fun onClick(v: View?) {
|
||||
myInterface.onClickListener(v,holder.adapterPosition)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return prevozi.list.size
|
||||
}
|
||||
}
|
@@ -0,0 +1,62 @@
|
||||
package com.example.mysecondapp
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.example.mysecondapp.databinding.FragmentListViewBinding
|
||||
import com.example.lib.Prevozi
|
||||
|
||||
class ListViewFragment(var activity: MainActivity) : Fragment(){
|
||||
|
||||
private lateinit var adapter: ListViewAdapter
|
||||
lateinit var binding: FragmentListViewBinding
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View? {
|
||||
binding = FragmentListViewBinding.inflate(inflater, container,false)
|
||||
|
||||
binding.itemView.layoutManager = LinearLayoutManager( binding.root.context )
|
||||
|
||||
adapter = ListViewAdapter(activity.app.prevozi, object: ListViewAdapter.MyOnClick{
|
||||
override fun onClickListener(p0: View?, position: Int) {
|
||||
val intent = Intent(activity, MapActivity::class.java)
|
||||
intent.putExtra("long", activity.app.prevozi.list[position].longitude)
|
||||
intent.putExtra("lati", activity.app.prevozi.list[position].latitude)
|
||||
startActivity(intent)
|
||||
}
|
||||
|
||||
override fun onLongClickListener(p0: View?, position: Int) {
|
||||
val builder = AlertDialog.Builder(binding.root.context) //access context from inner class
|
||||
//set title for alert dialog
|
||||
builder.setTitle("Delete")
|
||||
builder.setMessage(activity.app.prevozi.list[position].toString())
|
||||
builder.setIcon(android.R.drawable.ic_dialog_alert)
|
||||
builder.setPositiveButton("Yes") { dialogInterface, which -> //performing positive action
|
||||
//Toast.makeText(binding.root.context, "clicked yes", Toast.LENGTH_LONG).show()
|
||||
activity.app.prevozi.removeAt(position)
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
builder.setNeutralButton("Cancel") { dialogInterface, which -> //performing cancel action
|
||||
//Toast.makeText(binding.root.context, "clicked cancel\n operation cancel", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
builder.setNegativeButton("No") { dialogInterface, which -> //performing negative action
|
||||
//Toast.makeText(binding.root.context, "clicked No", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
// Create the AlertDialog
|
||||
val alertDialog: AlertDialog = builder.create()
|
||||
alertDialog.setCancelable(false)
|
||||
alertDialog.show()
|
||||
}
|
||||
})
|
||||
|
||||
binding.itemView.adapter = adapter
|
||||
|
||||
return binding.root
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -0,0 +1,75 @@
|
||||
package com.example.mysecondapp
|
||||
|
||||
import android.app.NotificationChannel
|
||||
import android.app.NotificationManager
|
||||
import android.app.PendingIntent
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.app.NotificationManagerCompat
|
||||
import com.example.mysecondapp.databinding.ActivityMainBinding
|
||||
import com.example.lib.Prevozi
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
lateinit var app: MyApplication
|
||||
lateinit var binding: ActivityMainBinding
|
||||
lateinit var listViewFragment: ListViewFragment
|
||||
lateinit var inputFragment: InputFragment
|
||||
|
||||
fun changeToInput(){
|
||||
supportFragmentManager.beginTransaction().apply {
|
||||
replace(R.id.flFrag, inputFragment)
|
||||
commit()
|
||||
}
|
||||
}
|
||||
|
||||
fun changeToList(){
|
||||
supportFragmentManager.beginTransaction().apply {
|
||||
replace(R.id.flFrag, listViewFragment)
|
||||
commit()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityMainBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
supportActionBar?.hide()
|
||||
app = application as MyApplication
|
||||
inputFragment = InputFragment(this)
|
||||
listViewFragment = ListViewFragment(this)
|
||||
|
||||
//Prevozi.generator(10, app.prevozi)
|
||||
//app.saveToFile()
|
||||
app.startNotification()
|
||||
|
||||
supportFragmentManager.beginTransaction().apply {
|
||||
replace(R.id.flFrag, listViewFragment)
|
||||
commit()
|
||||
}
|
||||
|
||||
|
||||
binding.button1.setOnClickListener{
|
||||
changeToList()
|
||||
}
|
||||
|
||||
binding.button2.setOnClickListener{
|
||||
app.editEl = false
|
||||
changeToInput()
|
||||
}
|
||||
|
||||
binding.button3.setOnClickListener {
|
||||
app.sendNotification()
|
||||
//Log.i("haha", app.prevozi.toString())
|
||||
|
||||
// val intent = Intent(this, MapActivity::class.java)
|
||||
// startActivity(intent)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,52 @@
|
||||
package com.example.mysecondapp
|
||||
|
||||
import android.content.Context
|
||||
import org.osmdroid.config.Configuration
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import com.example.mysecondapp.databinding.ActivityMapBinding
|
||||
import org.osmdroid.api.IMapController
|
||||
import org.osmdroid.tileprovider.tilesource.TileSourceFactory
|
||||
import org.osmdroid.util.GeoPoint
|
||||
import org.osmdroid.views.overlay.Marker
|
||||
|
||||
|
||||
class MapActivity : AppCompatActivity() {
|
||||
lateinit var binding: ActivityMapBinding
|
||||
lateinit var mapController: IMapController
|
||||
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
Configuration.getInstance().load(applicationContext, this.getPreferences(Context.MODE_PRIVATE))
|
||||
|
||||
binding = ActivityMapBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
var latitude = intent.getDoubleExtra("lati",0.0)
|
||||
var longitude = intent.getDoubleExtra("long",0.0)
|
||||
|
||||
|
||||
val map = binding.map
|
||||
map.setTileSource(TileSourceFactory.MAPNIK)
|
||||
map.setMultiTouchControls(true)
|
||||
mapController = map.controller
|
||||
|
||||
mapController.setZoom(20.0)
|
||||
|
||||
val startPoint = GeoPoint(longitude,latitude)
|
||||
|
||||
startPoint.latitude = startPoint.latitude + (20.0 - 0.5) * 0.001
|
||||
mapController.setCenter(startPoint)
|
||||
|
||||
var marker = Marker(map)
|
||||
marker.position = startPoint
|
||||
marker.title = "nikola"
|
||||
|
||||
map.overlays.add(marker)
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,87 @@
|
||||
package com.example.mysecondapp
|
||||
|
||||
import android.app.Application
|
||||
import android.app.NotificationChannel
|
||||
import android.app.NotificationManager
|
||||
import android.app.PendingIntent
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.util.Log
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.app.NotificationManagerCompat
|
||||
import com.example.lib.Prevozi
|
||||
import java.io.File
|
||||
import com.google.gson.Gson
|
||||
import org.apache.commons.io.FileUtils
|
||||
import java.io.IOException
|
||||
|
||||
|
||||
class MyApplication: Application() {
|
||||
lateinit var prevozi:Prevozi
|
||||
var editEl : Boolean = false
|
||||
var selectedEl : Int = 0
|
||||
val CHANNEL_ID = "com.example.mysecondapp.channel1"
|
||||
lateinit var notificationManager: NotificationManagerCompat
|
||||
lateinit var builder: NotificationCompat.Builder
|
||||
|
||||
val MY_JSON_NAME = "mydata.json"
|
||||
|
||||
private lateinit var gson: Gson
|
||||
private lateinit var file: File
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
gson = Gson()
|
||||
file = File(filesDir, MY_JSON_NAME)
|
||||
LoadData()
|
||||
}
|
||||
|
||||
fun LoadData() {
|
||||
prevozi = try {
|
||||
gson.fromJson(FileUtils.readFileToString(file), Prevozi::class.java)
|
||||
}catch (e:Exception){
|
||||
Log.i("haha", e.toString())
|
||||
Prevozi()
|
||||
}
|
||||
}
|
||||
|
||||
fun saveToFile() {
|
||||
try {
|
||||
FileUtils.writeStringToFile(file, gson.toJson(prevozi))
|
||||
} catch (e: IOException) {
|
||||
Log.i("haha", e.toString())
|
||||
}
|
||||
}
|
||||
|
||||
fun startNotification(){
|
||||
val intent = Intent(this, MainActivity::class.java)
|
||||
val pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
|
||||
|
||||
builder = NotificationCompat.Builder(this, CHANNEL_ID)
|
||||
.setSmallIcon(R.drawable.ic_launcher_foreground)
|
||||
.setContentTitle("My notification")
|
||||
.setContentText("Hello World!")
|
||||
.setContentIntent(pendingIntent)
|
||||
.setAutoCancel(true)
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
val name = getString(R.string.channel_name)
|
||||
val descriptionText = getString(R.string.channel_description)
|
||||
val importance = NotificationManager.IMPORTANCE_DEFAULT
|
||||
|
||||
val channel = NotificationChannel(CHANNEL_ID, name, importance).apply {
|
||||
description = descriptionText
|
||||
}
|
||||
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||
notificationManager.createNotificationChannel(channel)
|
||||
}
|
||||
|
||||
notificationManager = NotificationManagerCompat.from(this)
|
||||
}
|
||||
|
||||
fun sendNotification(){
|
||||
notificationManager.notify(1, builder.build())
|
||||
}
|
||||
}
|
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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=".MainActivity">
|
||||
|
||||
<Button
|
||||
android:id="@+id/button3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="3"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/button2" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:text="2"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/button1" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_margin="16dp"
|
||||
android:id="@+id/flFrag"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/barrier"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/barrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="top"
|
||||
app:constraint_referenced_ids="button1,button2,button3" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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=".MapActivity">
|
||||
|
||||
<org.osmdroid.views.MapView
|
||||
android:id="@+id/map"
|
||||
tilesource="Mapnik"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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=".InputFragment">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:ems="10"
|
||||
android:hint="@string/editNameHint"
|
||||
android:inputType="textPersonName"
|
||||
android:minHeight="48dp"
|
||||
app:layout_constraintStart_toEndOf="@+id/barrier"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editStartLocation"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:ems="10"
|
||||
android:hint="@string/editStartLocationHint"
|
||||
android:minHeight="48dp"
|
||||
android:inputType="none"
|
||||
app:layout_constraintStart_toEndOf="@+id/barrier"
|
||||
app:layout_constraintTop_toBottomOf="@+id/editName" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editEndLocation"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:ems="10"
|
||||
android:hint="@string/editEndLocationHint"
|
||||
android:minHeight="48dp"
|
||||
android:inputType="none"
|
||||
app:layout_constraintStart_toEndOf="@+id/barrier"
|
||||
app:layout_constraintTop_toBottomOf="@+id/editStartLocation" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textName"
|
||||
android:text="@string/textName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/editName"
|
||||
app:layout_constraintEnd_toEndOf="@+id/barrier"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textStartLoc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:text="@string/textStartLocation"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/editStartLocation"
|
||||
app:layout_constraintEnd_toEndOf="@+id/barrier"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textEndLoc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/textEndLocation"
|
||||
android:layout_margin="16dp"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/editEndLocation"
|
||||
app:layout_constraintEnd_toEndOf="@+id/barrier"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/barrier"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="right"
|
||||
android:layout_margin="16dp"
|
||||
app:constraint_referenced_ids="textName,textEndLoc,textStartLoc"
|
||||
tools:layout_editor_absoluteX="125dp"
|
||||
tools:layout_editor_absoluteY="111dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="256dp"
|
||||
android:text="@string/buttonEnter"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/editEndLocation" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|