Compare commits

...

20 Commits

Author SHA1 Message Date
Gilbert Kimutai
f561de2e72
Update README.md 2020-05-05 12:45:38 +03:00
Gilbert Kimutai
b6e5a32cd3 icon change on add to cart 2020-03-24 16:10:30 +03:00
Gilbert Kimutai
b941c425e8 Merge remote-tracking branch 'origin/master' 2020-03-15 13:04:07 +03:00
Gilbert Kimutai
250b805126 added offline cart repo 2020-03-15 13:03:52 +03:00
Gilbert Kimutai
7ffffd7e80 Added serialization annotation to attributes 2020-03-02 16:34:37 +03:00
Gilbert Kimutai
6d401b1f87
Added slack link 2020-01-08 06:11:36 +03:00
Gilbert Kimutai
00799f0830
Merge pull request #14 from gilokimu/cocart
Cocart Integration
2019-12-28 07:44:41 +03:00
Gilbert Kimutai
d528e38709 updated the cocart implementation 2019-12-17 05:15:48 +03:00
Gilbert Kimutai
e07d3236a3 added cocart api structure 2019-11-30 17:36:59 +03:00
Gilbert Kimutai
b7b8d020b7 update to androidx 2019-11-30 12:15:29 +03:00
Gilbert Kimutai
bf39bba675 Merge branch 'master' of https://github.com/gilokimu/WooDroid
 Conflicts:
	.idea/gradle.xml
2019-11-28 06:21:45 +03:00
Gilbert Kimutai
d0e88fa726 added working demo to test 2019-11-28 06:21:34 +03:00
gilo
0b3045ae81 added categories 2019-11-02 10:28:54 +03:00
Gilbert Kimutai
24c45491b6
Update README.md 2019-09-25 07:56:59 +03:00
Gilbert Kimutai
2cc68830e4 added working demo to test 2019-08-14 06:42:17 +03:00
Gilbert Kimutai
2f885897a0 added cart abstraction 2019-07-08 19:36:33 +03:00
Gilbert Kimutai
6591cf8f95 added cart abstraction 2019-07-08 06:19:41 +03:00
Gilbert Kimutai
47e5575417 updated fully to Kotlin 2019-06-08 12:27:15 +03:00
Gilbert Kimutai
7b13ab92c6
Merge pull request #8 from gilokimu/kotlin_refactor
Kotlin refactor
2019-06-08 12:13:38 +03:00
Gilbert Kimutai
b1de98db52
Icon addition
Added icon on readme
2019-06-01 10:52:45 +03:00
231 changed files with 3207 additions and 904 deletions

View File

@ -1,8 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<AndroidXmlCodeStyleSettings>
<option name="USE_CUSTOM_SETTINGS" value="true" />
</AndroidXmlCodeStyleSettings>
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
@ -12,6 +9,113 @@
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="USE_TAB_CHARACTER" value="true" />
</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>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />

13
.idea/compiler.xml generated Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel>
<module name="app" target="1.8" />
<module name="cocart" target="1.7" />
<module name="core" target="1.7" />
<module name="firebasecart" target="1.8" />
<module name="offlinecart" target="1.8" />
<module name="woodroid" target="1.8" />
</bytecodeTargetLevel>
</component>
</project>

7
.idea/gradle.xml generated
View File

@ -1,20 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="delegatedBuild" value="false" />
<option name="testRunner" value="PLATFORM" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/cocart" />
<option value="$PROJECT_DIR$/core" />
<option value="$PROJECT_DIR$/firebasecart" />
<option value="$PROJECT_DIR$/offlinecart" />
<option value="$PROJECT_DIR$/woodroid" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
<option name="testRunner" value="PLATFORM" />
</GradleProjectSettings>
</option>
</component>

View File

@ -1,5 +1,8 @@
# Woocommerce Android SDK
<img src="https://github.com/gilokimu/woocommerce-android-sdk/raw/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png"/>
# Woocommerce Android SDK
This is an woocommerce api client for android
<img src="https://github.com/gilokimu/woocommerce-android-sdk/raw/master/screens/screenshot-1553916911644.jpg" width="285"/> <img src="https://github.com/gilokimu/woocommerce-android-sdk/raw/master/screens/screenshot-1553916952806.jpg" width="285"/> <img src="https://github.com/gilokimu/woocommerce-android-sdk/raw/master/screens/screenshot-1553916959446.jpg" width="285"/> <img src="https://github.com/gilokimu/woocommerce-android-sdk/raw/master/screens/screenshot-1553916965766.jpg" width="285"/> <img src="https://github.com/gilokimu/woocommerce-android-sdk/raw/master/screens/screenshot-1553916980710.jpg" width="285"/> <img src="https://github.com/gilokimu/woocommerce-android-sdk/raw/master/screens/screenshot-1553916989454.jpg" width="285"/> <img src="https://github.com/gilokimu/woocommerce-android-sdk/raw/master/screens/screenshot-1553917011606.jpg" width="285"/>
@ -57,6 +60,16 @@ Generate API credentials (Consumer Key & Consumer Secret) following this instruc
Check out the WooCommerce API endpoints and data that can be manipulated in <https://woocommerce.github.io/woocommerce-rest-api-docs/>.
## Demo
I have left consumer key and secret within the app, for you to test the app without an installation of wordpress. To use my installation of wordpress, here are the credentials:
username: demo
password: demo2019
https://gilo.me/store/wp-admin
PS/ Do no harm
## Setup
Setup for the new WP REST API integration (WooCommerce 2.6 or later):
@ -224,5 +237,10 @@ The sample app implements an MVVM approach which would look slightly different f
## Contribution
Contributions are highly welcomed, just create a PR
## Slack
You can also reach out through <a href="https://join.slack.com/t/woodroid/shared_invite/enQtODg1ODYzMDAzOTcxLTE4NDA0MTYyYjY5ZmVmNTU4OTEzYWQzZDcwN2Y1ZTZkMzk4ZDY0ZGU4NmZlMzQ1NjlhM2RlZDc4Mjc4ZjE2NzI">slack</a> in case of any issues with installation or feature request
## Love the Project?
You can donate to support the project futher.<a class="donate-with-crypto" href="https://commerce.coinbase.com/checkout/3efb7008-27b1-4c64-934b-791e5c1a6cda"> Donate with Crypto </a>

View File

@ -4,15 +4,15 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 28
compileSdkVersion 29
defaultConfig {
applicationId "me.gilo.woodroid.app"
minSdkVersion 16
targetSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
@ -33,17 +33,52 @@ android {
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
dataBinding {
enabled = true
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
}
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
// To inline the bytecode built with JVM target 1.8 into
// bytecode that is being built with JVM target 1.6. (e.g. navArgs)
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == "com.android.support") {
if (!requested.name.startsWith("multidex")) {
details.useVersion "26.+"
}
}
}
all*.exclude group: 'com.google.guava', module: 'listenablefuture'
}
ext {
arch_version = '1.1.1'
firebase_version = '11.8.0'
support_lib_version = '28.0.0'
dagger_version = '2.15'
dagger_version = '2.14.1'
play_services = '15.0.1'
roomVersion = '1.1.1'
coroutinesVersion = "1.1.1"
}
kapt {
generateStubs = true
}
@ -51,63 +86,125 @@ kapt {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation 'androidx.paging:paging-runtime-ktx:2.1.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-firestore:17.1.1'
implementation 'com.google.firebase:firebase-storage:16.0.4'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
// Support Libs
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.browser:browser:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.viewpager2:viewpager2:1.0.0-rc01'
//firebase stuff
implementation 'com.google.firebase:firebase-database:19.2.0'
implementation 'com.google.firebase:firebase-auth:19.1.0'
implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.google.firebase:firebase-firestore:21.3.0'
implementation 'com.google.firebase:firebase-storage:19.1.0'
implementation 'com.firebaseui:firebase-ui-database:4.2.0'
implementation 'com.firebaseui:firebase-ui-firestore:4.2.0'
implementation 'com.firebaseui:firebase-ui-storage:4.2.0'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.firebase:firebase-messaging:20.0.1'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'io.github.inflationx:calligraphy3:3.0.0'
implementation 'io.github.inflationx:viewpump:1.0.0'
implementation 'io.github.inflationx:viewpump:2.0.3'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation project(path: ':woodroid')
// implementation 'com.github.gilokimu:woodroid:0.2.0'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.romandanylyk:pageindicatorview:0.2.0@aar'
// Android architecture components
implementation "android.arch.lifecycle:extensions:$arch_version"
annotationProcessor "android.arch.lifecycle:compiler:$arch_version"
implementation "android.arch.paging:runtime:1.0.1"
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0-rc02"
kapt "androidx.lifecycle:lifecycle-compiler:2.2.0-rc02"
implementation 'androidx.core:core-ktx:1.1.0'
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0-rc02"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0-rc02"
// Room components
implementation "androidx.room:room-runtime:2.2.1"
kapt "androidx.room:room-compiler:2.2.1"
androidTestImplementation "androidx.room:room-testing:2.2.1"
// Dagger.
implementation "com.google.dagger:dagger:$dagger_version"
implementation "com.google.dagger:dagger-android:$dagger_version"
implementation "com.google.dagger:dagger-android-support:$dagger_version"
kapt "com.google.dagger:dagger-android-processor:$dagger_version"
kapt "com.google.dagger:dagger-compiler:$dagger_version"
implementation "com.google.dagger:dagger:2.15"
implementation "com.google.dagger:dagger-android:2.15"
implementation "com.google.dagger:dagger-android-support:2.15"
kapt "com.google.dagger:dagger-android-processor:2.15"
kapt "com.google.dagger:dagger-compiler:2.15"
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.miguelcatalan:materialsearchview:1.4.0'
implementation 'me.relex:circleindicator:1.2.2@aar'
// Third-party libraries
implementation 'net.danlew:android.joda:2.9.9.4'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'android.arch.lifecycle:livedata:1.1.1'
implementation 'com.readystatesoftware.systembartint:systembartint:1.0.3'
implementation 'com.akexorcist:googledirectionlibrary:1.0.5'
//noinspection GradleDynamicVersion
implementation 'com.google.maps.android:android-maps-utils:0.5+'
implementation 'com.github.aarsy.googlemapsanimations:googlemapsanimations:1.0.5'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.jakewharton.retrofit:retrofit1-okhttp3-client:1.1.0'
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'io.reactivex:rxjava:1.3.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.room:room-runtime:2.2.2'
kapt 'androidx.room:room-compiler:2.2.2'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation "com.hootsuite.android:nachos:1.1.1"
implementation 'me.relex:circleindicator:1.2.2@aar'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"
implementation project(path: ':woodroid')
implementation project(path: ':firebasecart')
implementation project(path: ':core')
implementation project(path: ':cocart')
implementation project(path: ':offlinecart')
debugImplementation 'im.dino:dbinspector:3.4.1@aar'
implementation 'org.fabiomsr:moneytextview:1.1.0'
}

View File

@ -3,8 +3,14 @@ package me.gilo.woodroid.app;
public class Config {
public static String CURRENCY_SYMBOL = "Ksh.";
public static String siteUrl = "http://192.168.100.61/shop/index.php";
public static String consumerKey = "ck_da34628a4a69128001876492b842be4cd3c76bf8";
public static String consumerSecret = "cs_c3c70248288a60bc21a0cddc81acdc018df1632d";
public static String siteUrl = "https://gilo.me/store"; //sometimes you need to append /index.php at the end
public static String consumerKey = "ck_4ff858c97e1ed097cc24cb95593b2bcc45e835d5";
public static String consumerSecret = "cs_24865d302c443dec4a1391e5d2a438ba46e95cb6";
//sorry guys :( someday I am gonna add live and debug to have this stored somewhere
//for now commenting will do
// public static String siteUrl = "http://192.168.100.61/shop/index.php";
// public static String consumerKey = "ck_da34628a4a69128001876492b842be4cd3c76bf8";
// public static String consumerSecret = "cs_c3c70248288a60bc21a0cddc81acdc018df1632d";
}

View File

@ -2,7 +2,7 @@ package me.gilo.woodroid.app
import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import android.util.Log
import com.google.firebase.auth.FirebaseAuth
import me.gilo.raison.ui.user.onboarding.SignInActivity

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.adapter
import android.support.v7.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import me.gilo.woodroid.app.R

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.adapter
import android.support.v7.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import me.gilo.woodroid.app.R

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.adapter
import android.support.v7.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import me.gilo.woodroid.app.R

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.adapter
import android.support.v7.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import me.gilo.woodroid.app.R

View File

@ -2,7 +2,7 @@ package me.gilo.woodroid.app.adapter
import android.content.Context
import android.support.v4.view.PagerAdapter
import androidx.viewpager.widget.PagerAdapter
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.adapter
import android.support.v7.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import me.gilo.woodroid.app.R

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.adapter
import android.support.v7.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import me.gilo.woodroid.app.R

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.adapter
import android.support.v7.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import me.gilo.woodroid.app.R

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.adapter
import android.support.v7.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import me.gilo.woodroid.app.R

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.adapter
import android.support.v7.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import me.gilo.woodroid.app.R

View File

@ -2,7 +2,7 @@ package me.gilo.woodroid.app.adapter.viewholder
import android.content.Context
import android.content.Intent
import android.support.v7.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView
import android.text.Html
import android.view.View
import android.widget.ImageView

View File

@ -2,7 +2,7 @@ package me.gilo.woodroid.app.adapter.viewholder
import android.content.Context
import android.content.Intent
import android.support.v7.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView
import android.view.View
import android.widget.TextView
import me.gilo.woodroid.app.R

View File

@ -2,7 +2,7 @@ package me.gilo.woodroid.app.adapter.viewholder
import android.content.Context
import android.content.Intent
import android.support.v7.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView
import android.text.Html
import android.view.View
import android.widget.TextView

View File

@ -2,7 +2,7 @@ package me.gilo.woodroid.app.adapter.viewholder;
import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;
import me.gilo.woodroid.app.R;

View File

@ -2,7 +2,7 @@ package me.gilo.woodroid.app.adapter.viewholder
import android.content.Context
import android.content.Intent
import android.support.v7.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView
import android.text.SpannableString
import android.view.View
import android.widget.TextView

View File

@ -1,7 +1,7 @@
package me.gilo.woodroid.app.adapter.viewholder
import android.content.Context
import android.support.v7.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView
import android.text.Html
import android.view.View
import android.widget.ImageView

View File

@ -2,16 +2,16 @@ package me.gilo.woodroid.app.adapter.viewholder
import android.content.Context
import android.content.Intent
import android.support.v7.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView
import android.text.Html
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import com.squareup.picasso.Picasso
import me.gilo.woodroid.models.Product
import android.text.SpannableString
import me.gilo.woodroid.app.R
import me.gilo.woodroid.app.ui.product.ProductActivity
import me.gilo.woodroid.models.Product
class ProductViewHolder(val context: Context, itemView: View) :

View File

@ -1,9 +1,9 @@
package me.gilo.woodroid.app.common;
import android.annotation.SuppressLint;
import android.arch.lifecycle.ViewModel;
import android.arch.lifecycle.ViewModelProvider;
import android.arch.lifecycle.ViewModelProviders;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelProviders;
import android.content.Context;
import dagger.android.support.DaggerAppCompatActivity;
import io.github.inflationx.viewpump.ViewPumpContextWrapper;

View File

@ -1,7 +1,7 @@
package me.gilo.woodroid.app.common;
import android.arch.lifecycle.LiveData;
import android.support.annotation.NonNull;
import androidx.lifecycle.LiveData;
import androidx.annotation.NonNull;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.firestore.DocumentReference;

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.common
import android.arch.lifecycle.LiveData
import androidx.lifecycle.LiveData
import com.google.android.gms.tasks.OnCompleteListener
import com.google.android.gms.tasks.Task

View File

@ -1,7 +1,7 @@
package me.gilo.woodroid.app.common;
import android.arch.lifecycle.LiveData;
import android.support.annotation.NonNull;
import androidx.lifecycle.LiveData;
import androidx.annotation.NonNull;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.common;
import android.arch.lifecycle.LiveData;
import androidx.lifecycle.LiveData;
import com.google.firebase.firestore.*;

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.common;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView;
/**
* Created by amrro <amr.elghobary@gmail.com> on 9/15/17.

View File

@ -1,7 +1,7 @@
package me.gilo.woodroid.app.common;
import android.arch.lifecycle.LiveData;
import android.support.annotation.NonNull;
import androidx.lifecycle.LiveData;
import androidx.annotation.NonNull;
import com.google.firebase.firestore.*;
import me.gilo.woodroid.app.models.Model;

View File

@ -1,7 +1,7 @@
package me.gilo.woodroid.app.common;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.util.List;

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.common;
import android.arch.lifecycle.LiveData;
import androidx.lifecycle.LiveData;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

View File

@ -5,6 +5,7 @@ import dagger.Provides
import me.gilo.woodroid.app.Config
import me.gilo.woodroid.app.WcApp
import me.gilo.woodroid.Woocommerce
import me.gilo.woodroid.offlinecart.repo.RoomCartRepository
import javax.inject.Singleton
@ -35,4 +36,11 @@ class AppModule {
.build()
}
@Provides
@Singleton
internal fun providesRoomCartRepository(): RoomCartRepository = RoomCartRepository(app!!.baseContext)
}

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.di;
import android.arch.lifecycle.ViewModel;
import androidx.lifecycle.ViewModel;
import dagger.MapKey;
import java.lang.annotation.*;

View File

@ -1,7 +1,7 @@
package me.gilo.woodroid.app.di
import android.arch.lifecycle.ViewModel
import android.arch.lifecycle.ViewModelProvider
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import dagger.Binds
import dagger.Module
import dagger.multibindings.IntoMap

View File

@ -1,5 +1,4 @@
package me.gilo.woodroid.app.models;
import me.gilo.woodroid.models.Product;

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.models;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import com.google.firebase.firestore.IgnoreExtraProperties;
import com.google.firebase.firestore.ServerTimestamp;

View File

@ -12,8 +12,11 @@ import me.gilo.woodroid.app.common.QueryLiveData
import me.gilo.woodroid.app.common.WooLiveData
import me.gilo.woodroid.app.models.CartLineItem
import me.gilo.woodroid.Woocommerce
import me.gilo.woodroid.models.LineItem
import me.gilo.woodroid.core.cart.Cart
import me.gilo.woodroid.core.cart.CartItem
import me.gilo.woodroid.models.Product
import me.gilo.woodroid.offlinecart.repo.RoomCartRepository
import javax.inject.Inject
open class CartRepository @Inject
@ -71,26 +74,4 @@ constructor() {
}
}
fun addToCart(product: Product): CompletionGenericLiveData<DocumentReference> {
val completion = CompletionGenericLiveData<DocumentReference>()
val lineItem = CartLineItem()
lineItem.setProductId(product.id)
lineItem.product = product
lineItem.setQuantity(1)
cart.add(lineItem).addOnCompleteListener(completion)
return completion
}
fun cart(context: Context): WooLiveData<Map<String, LineItem>> {
val callBack = WooLiveData<Map<String, LineItem>>()
woocommerce.CartRepository(context).cart().enqueue(callBack)
return callBack
}
}

View File

@ -18,7 +18,7 @@ constructor() {
fun create(category: Category): WooLiveData<Category> {
val callBack = WooLiveData<Category>()
woocommerce!!.CategoryRepository().create(category).enqueue(callBack)
woocommerce.CategoryRepository().create(category).enqueue(callBack)
return callBack
}
@ -26,42 +26,42 @@ constructor() {
fun category(id: Int): WooLiveData<Category> {
val callBack = WooLiveData<Category>()
woocommerce!!.CategoryRepository().category(id).enqueue(callBack)
woocommerce.CategoryRepository().category(id).enqueue(callBack)
return callBack
}
fun categories(): WooLiveData<List<Category>> {
val callBack = WooLiveData<List<Category>>()
woocommerce!!.CategoryRepository().categories().enqueue(callBack)
woocommerce.CategoryRepository().categories().enqueue(callBack)
return callBack
}
fun categories(productCategoryFilter: ProductCategoryFilter): WooLiveData<List<Category>> {
val callBack = WooLiveData<List<Category>>()
woocommerce!!.CategoryRepository().categories(productCategoryFilter).enqueue(callBack)
woocommerce.CategoryRepository().categories(productCategoryFilter).enqueue(callBack)
return callBack
}
fun update(id: Int, category: Category): WooLiveData<Category> {
val callBack = WooLiveData<Category>()
woocommerce!!.CategoryRepository().update(id, category).enqueue(callBack)
woocommerce.CategoryRepository().update(id, category).enqueue(callBack)
return callBack
}
fun delete(id: Int): WooLiveData<Category> {
val callBack = WooLiveData<Category>()
woocommerce!!.CategoryRepository().delete(id).enqueue(callBack)
woocommerce.CategoryRepository().delete(id).enqueue(callBack)
return callBack
}
fun delete(id: Int, force: Boolean): WooLiveData<Category> {
val callBack = WooLiveData<Category>()
woocommerce!!.CategoryRepository().delete(id, force).enqueue(callBack)
woocommerce.CategoryRepository().delete(id, force).enqueue(callBack)
return callBack
}

View File

@ -1,7 +1,7 @@
package me.gilo.woodroid.app.ui
import android.content.Context
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import io.github.inflationx.viewpump.ViewPumpContextWrapper
import me.gilo.woodroid.app.Config
import me.gilo.woodroid.app.ui.state.ProgressDialogFragment

View File

@ -1,7 +1,7 @@
package me.gilo.woodroid.app.ui
import android.os.Bundle
import android.support.v7.widget.LinearLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import me.gilo.woodroid.app.R
import kotlinx.android.synthetic.main.activity_menu.*
@ -18,7 +18,11 @@ class MenuActivity : BaseActivity() {
title = "Menu"
val layoutManager = LinearLayoutManager(baseContext, LinearLayoutManager.VERTICAL, false)
val layoutManager = LinearLayoutManager(
baseContext,
LinearLayoutManager.VERTICAL,
false
)
rvMenu.layoutManager = layoutManager
rvMenu.isNestedScrollingEnabled = false

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.ui
import android.arch.lifecycle.ViewModel
import androidx.lifecycle.ViewModel
import android.content.Context
import android.content.Intent
import android.view.Menu
@ -87,7 +87,7 @@ abstract class WooDroidActivity<T : ViewModel> : BaseActivity() {
open fun cart() {
var viewModel = getViewModel(CartViewModel::class.java)
viewModel.cart().observe(this, android.arch.lifecycle.Observer { response ->
viewModel.cart().observe(this, androidx.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {

View File

@ -1,7 +1,7 @@
package me.gilo.woodroid.app.ui.checkout
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import me.gilo.woodroid.app.R
import kotlinx.android.synthetic.main.activity_checkout.*

View File

@ -2,7 +2,7 @@ package me.gilo.woodroid.app.ui.coupon
import android.content.Intent
import android.os.Bundle
import android.support.v7.widget.LinearLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import kotlinx.android.synthetic.main.activity_coupons.*
import kotlinx.android.synthetic.main.content_coupons.*
import me.gilo.woodroid.app.R
@ -28,7 +28,11 @@ class CouponsActivity : BaseActivity() {
title = "Coupons"
val layoutManager = LinearLayoutManager(baseContext, LinearLayoutManager.VERTICAL, false)
val layoutManager = LinearLayoutManager(
baseContext,
LinearLayoutManager.VERTICAL,
false
)
rvCoupons.layoutManager = layoutManager
rvCoupons.isNestedScrollingEnabled = false

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.ui.customer
import android.arch.lifecycle.Observer
import androidx.lifecycle.Observer
import android.content.Context
import android.os.Bundle
import android.widget.Toast

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.ui.customer
import android.arch.lifecycle.Observer
import androidx.lifecycle.Observer
import android.content.Context
import android.os.Bundle
import android.widget.Toast

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.ui.customer
import android.arch.lifecycle.Observer
import androidx.lifecycle.Observer
import android.content.Context
import android.content.Intent
import android.os.Bundle

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.ui.customer
import android.arch.lifecycle.Observer
import androidx.lifecycle.Observer
import android.content.Context
import android.os.Bundle
import android.widget.Toast

View File

@ -1,8 +1,8 @@
package me.gilo.woodroid.app.ui.home
import android.os.Bundle
import android.support.v4.app.Fragment
import android.support.v7.widget.LinearLayoutManager
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@ -46,7 +46,11 @@ class CategoryFragment : Fragment() {
viewModel = (activity as HomeActivity).getViewModel(CategoryViewModel::class.java)
val layoutManager = LinearLayoutManager(activity, LinearLayoutManager.VERTICAL, false)
val layoutManager = LinearLayoutManager(
activity,
LinearLayoutManager.VERTICAL,
false
)
rvCategory.layoutManager = layoutManager
rvCategory.isNestedScrollingEnabled = false
@ -64,7 +68,7 @@ class CategoryFragment : Fragment() {
val filter = ProductCategoryFilter()
filter.setPer_page(50)
viewModel.categories(filter).observe(this, android.arch.lifecycle.Observer { response ->
viewModel.categories(filter).observe(this, androidx.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {
}

View File

@ -1,8 +1,8 @@
package me.gilo.woodroid.app.ui.home
import android.os.Bundle
import android.support.design.widget.BottomNavigationView
import android.support.v4.app.Fragment
import com.google.android.material.bottomnavigation.BottomNavigationView
import androidx.fragment.app.Fragment
import kotlinx.android.synthetic.main.activity_home.*
import me.gilo.woodroid.app.R
import me.gilo.woodroid.app.ui.WooDroidActivity

View File

@ -1,8 +1,8 @@
package me.gilo.woodroid.app.ui.home
import android.os.Bundle
import android.support.v4.app.Fragment
import android.support.v7.widget.LinearLayoutManager
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@ -60,7 +60,11 @@ class HomeFragment : Fragment() {
}
private fun setUpProducts() {
val layoutManager = LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false)
val layoutManager = LinearLayoutManager(
activity,
LinearLayoutManager.HORIZONTAL,
false
)
rvShop.layoutManager = layoutManager
rvShop.isNestedScrollingEnabled = false
@ -74,7 +78,11 @@ class HomeFragment : Fragment() {
private fun setUpHoodies() {
val layoutManager = LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false)
val layoutManager = LinearLayoutManager(
activity,
LinearLayoutManager.HORIZONTAL,
false
)
rvHoodies.layoutManager = layoutManager
rvHoodies.isNestedScrollingEnabled = false
@ -102,7 +110,7 @@ class HomeFragment : Fragment() {
}
private fun products() {
viewModel.products().observe(this, android.arch.lifecycle.Observer { response ->
viewModel.products().observe(viewLifecycleOwner, androidx.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {
@ -133,7 +141,7 @@ class HomeFragment : Fragment() {
}
private fun products(filter: ProductFilter) {
viewModel.products(filter).observe(this, android.arch.lifecycle.Observer { response ->
viewModel.products(filter).observe(viewLifecycleOwner, androidx.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {
}

View File

@ -2,7 +2,7 @@ package me.gilo.woodroid.app.ui.home
import android.content.Intent
import android.os.Bundle
import android.support.v4.app.Fragment
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.ui.onboarding
import android.arch.lifecycle.Observer
import androidx.lifecycle.Observer
import android.content.Context
import android.content.Intent
import android.os.Bundle

View File

@ -1,6 +1,6 @@
package me.gilo.raison.ui.user.onboarding
import android.arch.lifecycle.Observer
import androidx.lifecycle.Observer
import android.content.Context
import android.content.Intent
import android.os.Bundle

View File

@ -1,6 +1,6 @@
package me.gilo.raison.ui.user.onboarding
import android.arch.lifecycle.Observer
import androidx.lifecycle.Observer
import android.content.Context
import android.content.Intent
import android.os.Bundle

View File

@ -1,8 +1,8 @@
package me.gilo.woodroid.app.ui.onboarding
import android.os.Bundle
import android.support.design.widget.Snackbar
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.snackbar.Snackbar
import me.gilo.woodroid.app.R
import kotlinx.android.synthetic.main.activity_user_details.*

View File

@ -2,7 +2,7 @@ package me.gilo.woodroid.app.ui.order
import android.content.Intent
import android.os.Bundle
import android.support.v7.widget.LinearLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import android.view.View
import kotlinx.android.synthetic.main.activity_my_orders.*
import kotlinx.android.synthetic.main.content_my_orders.*
@ -31,7 +31,11 @@ class MyOrdersActivity : WooDroidActivity<OrderViewModel>() {
viewModel = getViewModel(OrderViewModel::class.java)
title = "My Orders"
val layoutManager = LinearLayoutManager(baseContext, LinearLayoutManager.VERTICAL, false)
val layoutManager = LinearLayoutManager(
baseContext,
LinearLayoutManager.VERTICAL,
false
)
rvOrders.layoutManager = layoutManager
rvOrders.isNestedScrollingEnabled = false
@ -58,7 +62,7 @@ class MyOrdersActivity : WooDroidActivity<OrderViewModel>() {
}
private fun orders() {
viewModel.orders().observe(this, android.arch.lifecycle.Observer { response ->
viewModel.orders().observe(this, androidx.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {
showLoading()

View File

@ -1,7 +1,7 @@
package me.gilo.woodroid.app.ui.order
import android.os.Bundle
import android.support.v7.widget.LinearLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import kotlinx.android.synthetic.main.activity_order.*
import kotlinx.android.synthetic.main.content_order.*
import me.gilo.woodroid.app.R
@ -35,7 +35,11 @@ class OrderActivity : WooDroidActivity<OrderViewModel>() {
orderId = intent.getIntExtra("orderId", 0)
val layoutManager = LinearLayoutManager(baseContext, LinearLayoutManager.VERTICAL, false)
val layoutManager = LinearLayoutManager(
baseContext,
LinearLayoutManager.VERTICAL,
false
)
rvCart.layoutManager = layoutManager
rvCart.isNestedScrollingEnabled = false
@ -50,7 +54,7 @@ class OrderActivity : WooDroidActivity<OrderViewModel>() {
}
private fun order(orderId : Int) {
viewModel.order(orderId).observe(this, android.arch.lifecycle.Observer { response ->
viewModel.order(orderId).observe(this, androidx.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {
showLoading()
@ -97,7 +101,7 @@ class OrderActivity : WooDroidActivity<OrderViewModel>() {
var filter = ProductFilter()
filter.setInclude(productIds)
viewModel.products(filter).observe(this, android.arch.lifecycle.Observer { response ->
viewModel.products(filter).observe(this, androidx.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {
showLoading()

View File

@ -1,10 +1,10 @@
package me.gilo.woodroid.app.ui.product
import android.arch.lifecycle.Observer
import androidx.lifecycle.Observer
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.support.v7.widget.LinearLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import android.view.View
import android.widget.Toast
import io.github.inflationx.viewpump.ViewPumpContextWrapper
@ -49,7 +49,11 @@ class CartActivity : WooDroidActivity<CartViewModel>() {
viewModel = getViewModel(CartViewModel::class.java)
title = "Cart"
val layoutManager = LinearLayoutManager(baseContext, LinearLayoutManager.VERTICAL, false)
val layoutManager = LinearLayoutManager(
baseContext,
LinearLayoutManager.VERTICAL,
false
)
rvCart.layoutManager = layoutManager
rvCart.isNestedScrollingEnabled = false
@ -69,7 +73,7 @@ class CartActivity : WooDroidActivity<CartViewModel>() {
}
override fun cart() {
viewModel.cart().observe(this, android.arch.lifecycle.Observer { response ->
viewModel.cart().observe(this, androidx.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {
showLoading()
@ -106,7 +110,7 @@ class CartActivity : WooDroidActivity<CartViewModel>() {
private fun createOrder(order : Order) {
viewModel.createOrder(order).observe(this, android.arch.lifecycle.Observer { response ->
viewModel.createOrder(order).observe(this, androidx.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {
showLoading()
@ -217,7 +221,7 @@ class CartActivity : WooDroidActivity<CartViewModel>() {
}
private fun updateCart(cartLineItem: CartLineItem, quantity: Int) {
viewModel.setQuantity(cartLineItem, quantity).observe(this, android.arch.lifecycle.Observer { response ->
viewModel.setQuantity(cartLineItem, quantity).observe(this, androidx.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {
@ -242,7 +246,7 @@ class CartActivity : WooDroidActivity<CartViewModel>() {
private fun delete(cartLineItem: CartLineItem) {
viewModel.deleteItem(cartLineItem).observe(this, android.arch.lifecycle.Observer { response ->
viewModel.deleteItem(cartLineItem).observe(this, androidx.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {

View File

@ -3,7 +3,6 @@ package me.gilo.woodroid.app.ui.product
import android.content.Intent
import android.content.res.ColorStateList
import android.os.Bundle
import android.support.v4.content.ContextCompat
import android.text.Html
import android.view.Menu
import android.view.MenuItem
@ -11,6 +10,8 @@ import android.view.View
import android.widget.FrameLayout
import android.widget.TextView
import android.widget.Toast
import androidx.core.content.ContextCompat
import androidx.lifecycle.Observer
import kotlinx.android.synthetic.main.activity_product.*
import kotlinx.android.synthetic.main.content_product.*
import me.gilo.woodroid.app.R
@ -20,8 +21,11 @@ import me.gilo.woodroid.app.common.Status
import me.gilo.woodroid.app.events.ProductEvent
import me.gilo.woodroid.app.models.CartLineItem
import me.gilo.woodroid.app.ui.state.ProgressDialogFragment
import me.gilo.woodroid.app.utils.AppUtils
import me.gilo.woodroid.app.viewmodels.ProductViewModel
import me.gilo.woodroid.core.cart.CartItem
import me.gilo.woodroid.models.Product
import me.gilo.woodroid.offlinecart.repo.RoomCartRepository
import org.greenrobot.eventbus.EventBus
@ -51,67 +55,47 @@ class ProductActivity : BaseActivity() {
if (productId != 0){
product(productId)
checkIfExistsInCart(productId)
}
cart()
}
private fun checkIfExistsInCart(productId: Int) {
RoomCartRepository(baseContext).exists(productId).observe(this, Observer {productExists ->
if (productExists) {
fab.backgroundTintList = ColorStateList.valueOf(resources.getColor(R.color.carnation_red))
fab.setImageDrawable(ContextCompat.getDrawable(baseContext, R.drawable.baseline_remove_shopping_cart_24))
}else{
fab.backgroundTintList = ColorStateList.valueOf(resources.getColor(R.color.colorPrimary))
fab.setImageDrawable(ContextCompat.getDrawable(baseContext, R.drawable.baseline_add_shopping_cart_24))
}
productInCart = productExists
})
}
private fun addToCart(product: Product) {
viewModel.addToCart(product.id).observe(this, android.arch.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {
RoomCartRepository(baseContext).addToCart(
CartItem(
productId = product.id,
productImage = product.getFeatureImage(),
quantity = 1,
productPrice = product.price
)
}
Status.SUCCESS -> {
}
Status.ERROR -> {
}
Status.EMPTY -> {
}
}
})
)
}
private fun removeFromCart(cartLineItem: CartLineItem) {
viewModel.deleteItem(cartLineItem).observe(this, android.arch.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {
}
Status.SUCCESS -> {
}
Status.ERROR -> {
toast("error : " + response.error().message)
}
Status.EMPTY -> {
}
}
})
}
private fun product(productId : Int) {
viewModel.product(productId).observe(this, android.arch.lifecycle.Observer { response ->
viewModel.product(productId).observe(this, androidx.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {
flLoading.visibility = View.VISIBLE
@ -142,7 +126,7 @@ class ProductActivity : BaseActivity() {
private fun cart() {
viewModel.cart().observe(this, android.arch.lifecycle.Observer { response ->
viewModel.cart().observe(this, Observer { response ->
when (response!!.status()) {
Status.LOADING -> {
@ -163,8 +147,6 @@ class ProductActivity : BaseActivity() {
}
}
toggleFab()
if (cartItems.size == 0 && tvCartCounter != null){
tvCartCounter?.visibility = View.GONE
}else{
@ -182,7 +164,6 @@ class ProductActivity : BaseActivity() {
Status.EMPTY -> {
productInCart = false
cartItems.clear()
toggleFab()
if (cartItems.size == 0 && tvCartCounter != null){
tvCartCounter?.visibility = View.GONE
@ -197,17 +178,6 @@ class ProductActivity : BaseActivity() {
}
private fun toggleFab() {
if (productInCart) {
fab.backgroundTintList = ColorStateList.valueOf(resources.getColor(R.color.carnation_red))
fab.setImageDrawable(ContextCompat.getDrawable(baseContext, R.drawable.baseline_remove_shopping_cart_24))
}else{
fab.backgroundTintList = ColorStateList.valueOf(resources.getColor(R.color.colorPrimary))
fab.setImageDrawable(ContextCompat.getDrawable(baseContext, R.drawable.baseline_add_shopping_cart_24))
}
}
private fun setUpPage(product: Product) {
tvTitle.text = product.name
tvDescription.text = Html.fromHtml(product.description)

View File

@ -4,8 +4,8 @@ import android.app.SearchManager
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.support.v7.app.ActionBarDrawerToggle
import android.support.v7.widget.GridLayoutManager
import androidx.appcompat.app.ActionBarDrawerToggle
import androidx.recyclerview.widget.GridLayoutManager
import android.widget.Toast
import io.github.inflationx.viewpump.ViewPumpContextWrapper
import me.gilo.woodroid.app.R
@ -46,7 +46,8 @@ class ProductSearchActivity : BaseActivity() {
title = "Search"
val layoutManager = GridLayoutManager(baseContext, 2)
val layoutManager =
GridLayoutManager(baseContext, 2)
rvShop.layoutManager = layoutManager
rvShop.isNestedScrollingEnabled = false
@ -72,7 +73,7 @@ class ProductSearchActivity : BaseActivity() {
}
private fun search(query : String) {
viewModel.search(query).observe(this, android.arch.lifecycle.Observer { response ->
viewModel.search(query).observe(this, androidx.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {
showLoading("Performing search", "This will only take a short while")

View File

@ -2,8 +2,8 @@ package me.gilo.woodroid.app.ui.product
import android.content.Context
import android.os.Bundle
import android.support.v4.view.GravityCompat
import android.support.v7.widget.GridLayoutManager
import androidx.core.view.GravityCompat
import androidx.recyclerview.widget.GridLayoutManager
import android.view.Menu
import android.view.MenuItem
import android.widget.Toast
@ -16,6 +16,7 @@ import me.gilo.woodroid.app.adapter.ProductAdapter
import me.gilo.woodroid.app.common.BaseActivity
import me.gilo.woodroid.app.common.Status
import me.gilo.woodroid.app.ui.state.ProgressDialogFragment
import me.gilo.woodroid.app.utils.AppUtils
import me.gilo.woodroid.app.viewmodels.ProductViewModel
import me.gilo.woodroid.models.Product
import me.gilo.woodroid.models.filters.ProductFilter
@ -64,7 +65,8 @@ class ShopActivity : BaseActivity() {
}
private fun setUpPage() {
val layoutManager = GridLayoutManager(baseContext, 2)
val layoutManager =
GridLayoutManager(baseContext, 2)
rvShop.layoutManager = layoutManager
rvShop.isNestedScrollingEnabled = false
@ -103,7 +105,7 @@ class ShopActivity : BaseActivity() {
}
private fun products(filter: ProductFilter) {
viewModel.products(filter).observe(this, android.arch.lifecycle.Observer { response ->
viewModel.products(filter).observe(this, androidx.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {
}
@ -134,30 +136,11 @@ class ShopActivity : BaseActivity() {
}
private fun cart() {
viewModel.cart(baseContext).observe(this, android.arch.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {
}
Status.SUCCESS -> {
val cartResponse = response.data()
}
Status.ERROR -> {
}
Status.EMPTY -> {
}
}
})
val cartKey = AppUtils(baseContext).cartSession
}
private fun search(query : String) {
viewModel.search(query).observe(this, android.arch.lifecycle.Observer { response ->
viewModel.search(query).observe(this, androidx.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {
}
@ -189,7 +172,7 @@ class ShopActivity : BaseActivity() {
}
private fun products() {
viewModel.products().observe(this, android.arch.lifecycle.Observer { response ->
viewModel.products().observe(this, androidx.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {

View File

@ -1,7 +1,7 @@
package me.gilo.woodroid.app.ui.product.section
import android.os.Bundle
import android.support.v4.app.DialogFragment
import androidx.fragment.app.DialogFragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

View File

@ -1,8 +1,8 @@
package me.gilo.woodroid.app.ui.product.section
import android.os.Bundle
import android.support.v4.app.Fragment
import android.support.v7.widget.LinearLayoutManager
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import android.util.Log
import android.view.LayoutInflater
import android.view.View
@ -59,7 +59,11 @@ class ProductReviewsFragment : Fragment() {
private fun reviews(productId : Int) {
val layoutManager = LinearLayoutManager(activity, LinearLayoutManager.VERTICAL, false)
val layoutManager = LinearLayoutManager(
activity,
LinearLayoutManager.VERTICAL,
false
)
rvReviews.layoutManager = layoutManager
rvReviews.isNestedScrollingEnabled = false
@ -69,7 +73,7 @@ class ProductReviewsFragment : Fragment() {
rvReviews.adapter = productReviewAdapter
viewModel.reviews(productId).observe(this, android.arch.lifecycle.Observer { response ->
viewModel.reviews(productId).observe(this, androidx.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {
@ -136,7 +140,7 @@ class ProductReviewsFragment : Fragment() {
}
private fun save(review: ProductReview) {
viewModel.create(review).observe(this, android.arch.lifecycle.Observer { response ->
viewModel.create(review).observe(this, androidx.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {

View File

@ -1,8 +1,8 @@
package me.gilo.woodroid.app.ui.product.section
import android.os.Bundle
import android.support.v4.app.Fragment
import android.support.v7.widget.LinearLayoutManager
import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.LinearLayoutManager
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@ -57,7 +57,11 @@ class RelatedProductsFragment : Fragment() {
}
private fun similarProducts(product: Product) {
val layoutManager = LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false)
val layoutManager = LinearLayoutManager(
activity,
LinearLayoutManager.HORIZONTAL,
false
)
rvShop.layoutManager = layoutManager
rvShop.isNestedScrollingEnabled = false
@ -69,7 +73,7 @@ class RelatedProductsFragment : Fragment() {
val filter = ProductFilter()
filter.setInclude(product.related_ids.toIntArray())
viewModel.products(filter).observe(this, android.arch.lifecycle.Observer { response ->
viewModel.products(filter).observe(this, androidx.lifecycle.Observer { response ->
when (response!!.status()) {
Status.LOADING -> {

View File

@ -1,7 +1,7 @@
package me.gilo.woodroid.app.ui.state;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import androidx.fragment.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

View File

@ -4,7 +4,7 @@ import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Handler;
import android.support.annotation.StringRes;
import androidx.annotation.StringRes;
import android.util.Base64;
import android.view.inputmethod.InputMethodManager;
import android.widget.Toast;
@ -63,7 +63,7 @@ public class AppUtils {
public String getCartSession() {
SharedPreferences prefs = context.getSharedPreferences(MY_PREFS_NAME, context.MODE_PRIVATE);
return prefs.getString("cartSession", null);
return prefs.getString("cartSession", "");
}
public String getExpiry() {

View File

@ -1,7 +1,7 @@
package me.gilo.woodroid.app.utils;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;

View File

@ -16,9 +16,9 @@
package me.gilo.woodroid.app.utils;
import android.arch.lifecycle.ViewModel;
import android.arch.lifecycle.ViewModelProvider;
import android.support.annotation.NonNull;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;
import androidx.annotation.NonNull;
import javax.inject.Inject;
import javax.inject.Provider;

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.viewmodels;
import android.arch.lifecycle.ViewModel;
import androidx.lifecycle.ViewModel;
import android.content.Context;
import com.google.firebase.firestore.DocumentReference;
import me.gilo.woodroid.app.common.CompletionGenericLiveData;
@ -10,6 +10,7 @@ import me.gilo.woodroid.app.models.CartLineItem;
import me.gilo.woodroid.app.repo.CartRepository;
import me.gilo.woodroid.app.repo.CustomerRepository;
import me.gilo.woodroid.app.repo.OrderRepository;
import me.gilo.woodroid.models.*;
import javax.inject.Inject;
@ -30,10 +31,6 @@ public final class CartViewModel extends ViewModel {
this.customerRepository = customerRepository;
}
public CompletionGenericLiveData<DocumentReference> addToCart(Product product) {
return cartRepository.addToCart(product);
}
public QueryLiveData<CartLineItem> cart() {
return cartRepository.cart();
}
@ -50,10 +47,6 @@ public final class CartViewModel extends ViewModel {
return cartRepository.setQuantity(cartLineItem, quantity);
}
public WooLiveData<Map<String, LineItem>> cart(Context context) {
return cartRepository.cart(context);
}
public WooLiveData<Order> createOrder(Order order) {
return orderRepository.create(order);
}

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.viewmodels;
import android.arch.lifecycle.ViewModel;
import androidx.lifecycle.ViewModel;
import me.gilo.woodroid.app.common.WooLiveData;
import me.gilo.woodroid.app.repo.CategoryRepository;
import me.gilo.woodroid.models.Category;

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.viewmodels;
import android.arch.lifecycle.ViewModel;
import androidx.lifecycle.ViewModel;
import me.gilo.woodroid.app.common.WooLiveData;
import me.gilo.woodroid.app.repo.CustomerRepository;
import me.gilo.woodroid.models.Customer;

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.viewmodels;
import android.arch.lifecycle.ViewModel;
import androidx.lifecycle.ViewModel;
import me.gilo.woodroid.app.common.WooLiveData;
import me.gilo.woodroid.app.repo.OrderRepository;
import me.gilo.woodroid.app.repo.ProductRepository;

View File

@ -1,9 +1,7 @@
package me.gilo.woodroid.app.viewmodels;
import android.arch.lifecycle.MutableLiveData;
import android.arch.lifecycle.ViewModel;
import android.content.Context;
import com.google.firebase.firestore.DocumentReference;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import me.gilo.woodroid.app.common.CompletionGenericLiveData;
import me.gilo.woodroid.app.common.QueryLiveData;
import me.gilo.woodroid.app.common.WooLiveData;
@ -11,7 +9,7 @@ import me.gilo.woodroid.app.models.CartLineItem;
import me.gilo.woodroid.app.repo.CartRepository;
import me.gilo.woodroid.app.repo.OrderRepository;
import me.gilo.woodroid.app.repo.ProductRepository;
import me.gilo.woodroid.models.LineItem;
import me.gilo.woodroid.models.Order;
import me.gilo.woodroid.models.Product;
import me.gilo.woodroid.models.ProductReview;
@ -50,9 +48,6 @@ public final class ProductViewModel extends ViewModel {
return productRepository.products();
}
public CompletionGenericLiveData<DocumentReference> addToCart(Product product) {
return cartRepository.addToCart(product);
}
public WooLiveData<Order> addToCart(int productId) {
return orderRepository.addToCart(productId);
@ -74,10 +69,6 @@ public final class ProductViewModel extends ViewModel {
return cartRepository.setQuantity(cartLineItem, quantity);
}
public WooLiveData<Map<String, LineItem>> cart(Context context) {
return cartRepository.cart(context);
}
public WooLiveData<List<Product>> products(ProductFilter filter) {
return productRepository.products(filter);
}

View File

@ -1,6 +1,6 @@
package me.gilo.woodroid.app.viewmodels;
import android.arch.lifecycle.ViewModel;
import androidx.lifecycle.ViewModel;
import me.gilo.woodroid.app.common.WooLiveData;
import me.gilo.woodroid.app.repo.ReviewRepository;
import me.gilo.woodroid.models.ProductReview;

View File

@ -1,7 +1,7 @@
package me.gilo.woodroid.app.viewmodels;
import android.arch.lifecycle.MutableLiveData;
import android.arch.lifecycle.ViewModel;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.auth.AuthResult;

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="#ffffff"
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
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"
@ -7,20 +7,20 @@
android:layout_height="match_parent"
tools:context=".app.ui.coupon.AddCouponActivity">
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_add_coupon"/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
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"
@ -7,20 +7,20 @@
android:layout_height="match_parent"
tools:context=".app.ui.onboarding.AnonymousSignInActivity">
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_anonymous_sign_in"/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
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"
@ -9,4 +9,4 @@
<include layout="@layout/customer_basic_details"/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
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"
@ -10,4 +10,4 @@
<include layout="@layout/customer_billing_address"/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,25 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
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=".app.ui.product.CartActivity">
>
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_cart"/>
@ -58,7 +58,7 @@
<ImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:src="@drawable/ic_action_navigation_arrow_back_inverted"
app:srcCompat="@drawable/baseline_arrow_back_24"
android:tint="#ffffff"
android:layout_gravity="right|center"
android:rotation="180"
@ -67,4 +67,4 @@
</FrameLayout>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
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"
@ -7,23 +7,23 @@
android:layout_height="match_parent"
tools:context=".app.ui.checkout.CheckoutActivity">
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_checkout"/>
<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -31,4 +31,4 @@
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_email"/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
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"
@ -7,20 +7,20 @@
android:layout_height="match_parent"
tools:context=".app.ui.coupon.CouponActivity">
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_coupon"/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
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"
@ -7,23 +7,23 @@
android:layout_height="match_parent"
tools:context=".app.ui.coupon.CouponsActivity">
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_coupons"/>
<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -33,4 +33,4 @@
android:layout_margin="16dp" />
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -7,12 +7,12 @@
android:orientation="vertical"
tools:context=".app.ui.home.HomeActivity">
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
@ -20,7 +20,7 @@
app:title="WooDroid"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<LinearLayout
@ -31,7 +31,7 @@
android:orientation="vertical"
/>
<android.support.design.widget.BottomNavigationView
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".app.MainActivity"
android:layout_margin="16dp"
>
@ -41,4 +40,4 @@
app:layout_constraintTop_toBottomOf="@+id/imageView2"/>
</android.support.constraint.ConstraintLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
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"
@ -7,21 +7,21 @@
android:layout_height="match_parent"
tools:context=".app.ui.MenuActivity">
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_menu"/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
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"
@ -7,19 +7,19 @@
android:layout_height="match_parent"
tools:context=".app.ui.order.MyOrdersActivity">
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_my_orders"/>
@ -58,7 +58,7 @@
<ImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:src="@drawable/ic_action_navigation_arrow_back_inverted"
app:srcCompat="@drawable/baseline_arrow_back_24"
android:tint="#ffffff"
android:layout_gravity="right|center"
android:rotation="180"
@ -67,4 +67,4 @@
</FrameLayout>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
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"
@ -7,22 +7,22 @@
android:layout_height="match_parent"
tools:context=".app.ui.order.OrderActivity">
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_order"/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
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"
@ -7,19 +7,19 @@
android:layout_height="match_parent"
tools:context=".app.ui.product.ProductActivity">
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_product"/>
@ -41,17 +41,17 @@
</FrameLayout>
<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:src="@drawable/baseline_add_shopping_cart_24"
app:srcCompat="@drawable/baseline_add_shopping_cart_24"
android:tint="#ffffff"
/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
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"
@ -7,20 +7,20 @@
android:layout_height="match_parent"
tools:context=".app.ui.product.ProductSearchActivity">
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_product_search"/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
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"
@ -7,20 +7,20 @@
android:layout_height="match_parent"
tools:context=".app.ui.customer.ProfileActivity">
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_profile"/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
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"
@ -10,4 +10,4 @@
<include layout="@layout/customer_shipping_address"/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
<androidx.drawerlayout.widget.DrawerLayout
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"
@ -9,17 +9,17 @@
tools:context=".app.ui.product.ShopActivity"
tools:openDrawer="end">
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
@ -27,14 +27,14 @@
app:popupTheme="@style/AppTheme.PopupOverlay">
</android.support.v7.widget.Toolbar>
</androidx.appcompat.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_shop"/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<include
layout="@layout/drawer_filter"
@ -44,4 +44,4 @@
/>
</android.support.v4.widget.DrawerLayout>
</androidx.drawerlayout.widget.DrawerLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout 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"
@ -8,4 +8,4 @@
<include layout="@layout/content_sign_in" />
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout 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"
@ -8,4 +8,4 @@
<include layout="@layout/content_sign_up" />
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
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"
@ -7,23 +7,23 @@
android:layout_height="match_parent"
tools:context=".app.ui.onboarding.UserDetailsActivity">
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_user_details"/>
<android.support.design.widget.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -31,4 +31,4 @@
android:layout_margin="@dimen/fab_margin"
app:srcCompat="@android:drawable/ic_dialog_email"/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -11,7 +11,7 @@
app:layout_behavior="@string/appbar_scrolling_view_behavior"
>
<android.support.v4.widget.NestedScrollView
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
@ -24,7 +24,7 @@
android:background="@drawable/rect_white"
android:orientation="vertical">
<android.support.v7.widget.AppCompatEditText
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/etCode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -39,7 +39,7 @@
/>
<android.support.v7.widget.AppCompatEditText
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/etDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -57,7 +57,7 @@
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</androidx.core.widget.NestedScrollView>
<Button
android:id="@+id/bCreate"

Some files were not shown because too many files have changed in this diff Show More