Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 26
compileSdkVersion 31
defaultConfig {
applicationId "ru.evotor.egais.api.example"
minSdkVersion 22
targetSdkVersion 26
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -20,21 +20,21 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'

implementation 'com.android.support:design:26.1.0'
implementation 'com.github.evotor:egais-api:0.0.1'
implementation 'ru.evotor:egais-api:0.0.121-dev'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

This file was deleted.

11 changes: 10 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
android:supportsRtl="true"
android:theme="@style/AppTheme">

<activity android:name=".MainActivity">
<activity
android:name=".MainActivity"
android:exported="true">
<meta-data
android:name="ru.evotor.launcher.BACKGROUND_COLOR"
android:value="#133700" />
Expand Down Expand Up @@ -103,6 +105,13 @@
android:value="ru.evotor.egais.api.example.shop_commodity.ShopCommodityListActivity" />
</activity>
<activity android:name=".client_settings.ClientSettingsActivity"></activity>

<activity
android:name=".unrocessed_documents.UnprocessedDocumentsActivity"
android:label="@string/title_unprocessed_documents"
android:parentActivityName=".unrocessed_documents.UnprocessedDocumentsActivity"
android:theme="@style/AppTheme.NoActionBar" />

</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ package ru.evotor.egais.api.example

import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*
import ru.evotor.egais.api.example.stock_commodity.StockCommodityListActivity
import ru.evotor.egais.api.example.actwriteoff.ActWriteOffListActivity
import ru.evotor.egais.api.example.client_settings.ClientSettingsActivity
import ru.evotor.egais.api.example.orginfo.OrgInfoListActivity
import ru.evotor.egais.api.example.product.ProductListActivity
import ru.evotor.egais.api.example.shop_commodity.ShopCommodityListActivity
import ru.evotor.egais.api.example.unrocessed_documents.UnprocessedDocumentsActivity
import ru.evotor.egais.api.example.waybill.WaybillListActivity

class MainActivity : AppCompatActivity() {
Expand Down Expand Up @@ -45,5 +46,8 @@ class MainActivity : AppCompatActivity() {
clientSettings.setOnClickListener {
startActivity(Intent(this@MainActivity, ClientSettingsActivity::class.java))
}
unprocessedDocuments.setOnClickListener {
startActivity(Intent(this@MainActivity, UnprocessedDocumentsActivity::class.java))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ru.evotor.egais.api.example.actwriteoff

import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import android.view.MenuItem
import kotlinx.android.synthetic.main.activity_actwriteoff_detail.*
import ru.evotor.egais.api.example.R
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package ru.evotor.egais.api.example.actwriteoff

import android.os.Bundle
import android.support.v4.app.Fragment
import android.support.v4.app.LoaderManager
import android.support.v4.content.AsyncTaskLoader
import android.support.v4.content.Loader
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.loader.app.LoaderManager
import androidx.loader.content.AsyncTaskLoader
import androidx.loader.content.Loader
import kotlinx.android.synthetic.main.activity_actwriteoff_detail.*
import kotlinx.android.synthetic.main.actwriteoff_detail.*
import ru.evotor.egais.api.example.R
Expand All @@ -24,7 +24,7 @@ class ActWriteOffDetailFragment : Fragment(), LoaderManager.LoaderCallbacks<ActW
private var mItem: ActWriteOffWithPositions? = null

override fun onCreateLoader(id: Int, args: Bundle?): Loader<ActWriteOffWithPositions?> {
class ActWriteOffLoader : AsyncTaskLoader<ActWriteOffWithPositions?>(context) {
class ActWriteOffLoader : AsyncTaskLoader<ActWriteOffWithPositions?>(requireContext()) {
override fun loadInBackground(): ActWriteOffWithPositions? {
return arguments?.let {
if (it.containsKey(ActWriteOffDetailFragment.ARG_ITEM_ID)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package ru.evotor.egais.api.example.actwriteoff

import android.content.Intent
import android.os.Bundle
import android.support.v4.app.LoaderManager
import android.support.v4.content.AsyncTaskLoader
import android.support.v4.content.Loader
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.RecyclerView
import androidx.loader.app.LoaderManager
import androidx.loader.content.AsyncTaskLoader
import androidx.loader.content.Loader
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand Down Expand Up @@ -43,11 +43,11 @@ class ActWriteOffListActivity : AppCompatActivity(), LoaderManager.LoaderCallbac
return ProductInfoLoader()
}

override fun onLoadFinished(loader: Loader<Cursor<ActWriteOff>>?, data: Cursor<ActWriteOff>?) {
override fun onLoadFinished(loader: Loader<Cursor<ActWriteOff>>, data: Cursor<ActWriteOff>?) {
(actwriteoff_list.adapter as ActWriteOffListActivity.SimpleItemRecyclerViewAdapter).swapCursor(data)
}

override fun onLoaderReset(loader: Loader<Cursor<ActWriteOff>>?) {
override fun onLoaderReset(loader: Loader<Cursor<ActWriteOff>>) {
(actwriteoff_list.adapter as ActWriteOffListActivity.SimpleItemRecyclerViewAdapter).swapCursor(null)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package ru.evotor.egais.api.example.client_settings

import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.support.v7.widget.AppCompatButton
import android.widget.Toast
import androidx.appcompat.widget.AppCompatButton
import ru.evotor.egais.api.example.R
import ru.evotor.egais.api.query.ClientSettingsQuery
import ru.evotor.egais.api.query.settings.ClientSettingsQuery

class ClientSettingsActivity : AppCompatActivity() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ru.evotor.egais.api.example.orginfo

import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import android.view.MenuItem
import kotlinx.android.synthetic.main.activity_orginfo_detail.*
import ru.evotor.egais.api.example.R
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package ru.evotor.egais.api.example.orginfo

import android.os.Bundle
import android.support.v4.app.Fragment
import android.support.v4.app.LoaderManager
import android.support.v4.content.AsyncTaskLoader
import android.support.v4.content.Loader
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.loader.app.LoaderManager
import androidx.loader.content.AsyncTaskLoader
import androidx.loader.content.Loader
import kotlinx.android.synthetic.main.activity_orginfo_detail.*
import kotlinx.android.synthetic.main.orginfo_detail.*
import ru.evotor.egais.api.example.R
Expand All @@ -25,20 +25,20 @@ class OrgInfoDetailFragment : Fragment(), LoaderManager.LoaderCallbacks<OrgInfo?
private var mItem: OrgInfo? = null

override fun onCreateLoader(id: Int, args: Bundle?): Loader<OrgInfo?> {
class OrgInfoLoader : AsyncTaskLoader<OrgInfo?>(context) {
class OrgInfoLoader : AsyncTaskLoader<OrgInfo?>(requireContext()) {
override fun loadInBackground(): OrgInfo? {
return arguments?.let {
if (it.containsKey(ARG_ITEM_ID)) {
// Load the dummy content specified by the fragment
// arguments. In a real-world scenario, use a Loader
// to load content from a content provider.
OrgInfoQuery()
.clientRegId.equal(it.getString(ARG_ITEM_ID))
.execute(context)
.let { cursor ->
cursor.moveToFirst()
cursor.getValue()
}
.clientRegId.equal(it.getString(ARG_ITEM_ID) ?: "")
.execute(context)
.let { cursor ->
cursor.moveToFirst()
cursor.getValue()
}
} else {
null
}
Expand Down Expand Up @@ -73,8 +73,10 @@ class OrgInfoDetailFragment : Fragment(), LoaderManager.LoaderCallbacks<OrgInfo?
activity?.toolbar_layout?.title = mItem?.clientRegId
}

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val rootView = inflater.inflate(R.layout.orginfo_detail, container, false)

// Show the dummy content as text in a TextView.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ package ru.evotor.egais.api.example.orginfo

import android.content.Intent
import android.os.Bundle
import android.support.v4.app.LoaderManager
import android.support.v4.content.AsyncTaskLoader
import android.support.v4.content.Loader
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import androidx.loader.app.LoaderManager
import androidx.loader.content.AsyncTaskLoader
import androidx.loader.content.Loader
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.activity_orginfo_list.*
import kotlinx.android.synthetic.main.orginfo_list.*
import kotlinx.android.synthetic.main.orginfo_list_content.view.*
Expand Down Expand Up @@ -43,11 +43,11 @@ class OrgInfoListActivity : AppCompatActivity(), LoaderManager.LoaderCallbacks<C
return OrgInfoLoader()
}

override fun onLoadFinished(loader: Loader<Cursor<OrgInfo>>?, data: Cursor<OrgInfo>?) {
override fun onLoadFinished(loader: Loader<Cursor<OrgInfo>>, data: Cursor<OrgInfo>?) {
(orginfo_list.adapter as SimpleItemRecyclerViewAdapter).swapCursor(data)
}

override fun onLoaderReset(loader: Loader<Cursor<OrgInfo>>?) {
override fun onLoaderReset(loader: Loader<Cursor<OrgInfo>>) {
(orginfo_list.adapter as SimpleItemRecyclerViewAdapter).swapCursor(null)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ru.evotor.egais.api.example.product

import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import android.view.MenuItem
import kotlinx.android.synthetic.main.activity_product_detail.*
import ru.evotor.egais.api.example.R
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package ru.evotor.egais.api.example.product

import android.os.Bundle
import android.support.v4.app.Fragment
import android.support.v4.app.LoaderManager
import android.support.v4.content.AsyncTaskLoader
import android.support.v4.content.Loader
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.loader.app.LoaderManager
import androidx.loader.content.AsyncTaskLoader
import androidx.loader.content.Loader
import kotlinx.android.synthetic.main.activity_product_detail.*
import kotlinx.android.synthetic.main.product_detail.*
import ru.evotor.egais.api.example.R
Expand All @@ -28,20 +28,20 @@ class ProductDetailFragment : Fragment(), LoaderManager.LoaderCallbacks<ProductI
private var mItem: ProductInfo? = null

override fun onCreateLoader(id: Int, args: Bundle?): Loader<ProductInfo?> {
class ProductInfoLoader : AsyncTaskLoader<ProductInfo?>(context) {
class ProductInfoLoader : AsyncTaskLoader<ProductInfo?>(requireContext()) {
override fun loadInBackground(): ProductInfo? {
return arguments?.let {
if (it.containsKey(ProductDetailFragment.ARG_ITEM_ID)) {
// Load the dummy content specified by the fragment
// arguments. In a real-world scenario, use a Loader
// to load content from a content provider.
ProductInfoQuery()
.alcCode.equal(it.getString(ProductDetailFragment.ARG_ITEM_ID))
.execute(context)
.let { cursor ->
cursor.moveToFirst()
cursor.getValue()
}
.alcCode.equal(it.getString(ProductDetailFragment.ARG_ITEM_ID))
.execute(context)
.let { cursor ->
cursor.moveToFirst()
cursor.getValue()
}
} else {
null
}
Expand Down Expand Up @@ -76,8 +76,10 @@ class ProductDetailFragment : Fragment(), LoaderManager.LoaderCallbacks<ProductI
activity?.toolbar_layout?.title = mItem?.alcCode
}

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val rootView = inflater.inflate(R.layout.product_detail, container, false)

// Show the dummy content as text in a TextView.
Expand Down
Loading