Changes on product layout
This commit is contained in:
parent
db41825cc3
commit
c3697b297f
10
.idea/codeStyles/Project.xml
generated
10
.idea/codeStyles/Project.xml
generated
@ -1,8 +1,18 @@
|
|||||||
<component name="ProjectCodeStyleConfiguration">
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
<code_scheme name="Project" version="173">
|
<code_scheme name="Project" version="173">
|
||||||
|
<AndroidXmlCodeStyleSettings>
|
||||||
|
<option name="USE_CUSTOM_SETTINGS" value="true" />
|
||||||
|
</AndroidXmlCodeStyleSettings>
|
||||||
<JetCodeStyleSettings>
|
<JetCodeStyleSettings>
|
||||||
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||||
</JetCodeStyleSettings>
|
</JetCodeStyleSettings>
|
||||||
|
<codeStyleSettings language="XML">
|
||||||
|
<indentOptions>
|
||||||
|
<option name="INDENT_SIZE" value="2" />
|
||||||
|
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
||||||
|
<option name="USE_TAB_CHARACTER" value="true" />
|
||||||
|
</indentOptions>
|
||||||
|
</codeStyleSettings>
|
||||||
<codeStyleSettings language="kotlin">
|
<codeStyleSettings language="kotlin">
|
||||||
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||||
</codeStyleSettings>
|
</codeStyleSettings>
|
||||||
|
|||||||
16
README.md
16
README.md
@ -14,10 +14,10 @@ Step 1. Add the JitPack repository to your build file
|
|||||||
|
|
||||||
```xml
|
```xml
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>jitpack.io</id>
|
<id>jitpack.io</id>
|
||||||
<url>https://jitpack.io</url>
|
<url>https://jitpack.io</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -35,10 +35,10 @@ Step 1. Add the JitPack repository to your build file
|
|||||||
|
|
||||||
```gradle
|
```gradle
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
...
|
...
|
||||||
maven { url 'https://jitpack.io' }
|
maven { url 'https://jitpack.io' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -2,61 +2,64 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="me.gilo.wc">
|
package="me.gilo.wc">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".WcApp"
|
android:name=".WcApp"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme">
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.product.ProductSearchActivity"
|
android:name=".ui.product.ProductActivity"
|
||||||
android:label="@string/title_activity_product_search"
|
android:label="@string/title_activity_product"
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".ui.product.ProductSearchActivity"
|
||||||
|
android:label="@string/title_activity_product_search"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.SEARCH"/>
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".ui.coupon.CouponActivity"
|
||||||
|
android:label="@string/title_activity_coupon"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".ui.coupon.CouponsActivity"
|
||||||
|
android:label="@string/title_activity_coupons"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".ui.coupon.AddCouponActivity"
|
||||||
|
android:label="@string/title_activity_add_coupon"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".ui.MenuActivity"
|
||||||
|
android:label="@string/title_activity_menu"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".ui.product.ShopActivity"
|
||||||
|
android:label="@string/title_activity_shop"
|
||||||
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.searchable"
|
||||||
|
android:resource="@xml/searchable"/>
|
||||||
|
</activity>
|
||||||
|
<activity android:name=".MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
|
|
||||||
<intent-filter>
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
<action android:name="android.intent.action.SEARCH" />
|
</intent-filter>
|
||||||
</intent-filter>
|
</activity>
|
||||||
|
</application>
|
||||||
</activity>
|
|
||||||
<activity
|
|
||||||
android:name=".ui.coupon.CouponActivity"
|
|
||||||
android:label="@string/title_activity_coupon"
|
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
|
||||||
</activity>
|
|
||||||
<activity
|
|
||||||
android:name=".ui.coupon.CouponsActivity"
|
|
||||||
android:label="@string/title_activity_coupons"
|
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
|
||||||
</activity>
|
|
||||||
<activity
|
|
||||||
android:name=".ui.coupon.AddCouponActivity"
|
|
||||||
android:label="@string/title_activity_add_coupon"
|
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
|
||||||
</activity>
|
|
||||||
<activity
|
|
||||||
android:name=".ui.MenuActivity"
|
|
||||||
android:label="@string/title_activity_menu"
|
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
|
||||||
</activity>
|
|
||||||
<activity
|
|
||||||
android:name=".ui.product.ShopActivity"
|
|
||||||
android:label="@string/title_activity_shop"
|
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
|
||||||
<meta-data
|
|
||||||
android:name="android.app.searchable"
|
|
||||||
android:resource="@xml/searchable"/>
|
|
||||||
</activity>
|
|
||||||
<activity android:name=".MainActivity">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
</application>
|
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@ -1,14 +1,23 @@
|
|||||||
package me.gilo.wc.adapter.viewholder
|
package me.gilo.wc.adapter.viewholder
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
import android.support.v7.widget.RecyclerView
|
import android.support.v7.widget.RecyclerView
|
||||||
import android.text.Html
|
import android.text.Html
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import com.squareup.picasso.Picasso
|
import com.squareup.picasso.Picasso
|
||||||
import me.gilo.wc.R
|
|
||||||
import me.gilo.woodroid.models.Product
|
import me.gilo.woodroid.models.Product
|
||||||
|
import android.text.Spannable
|
||||||
|
import android.text.style.ForegroundColorSpan
|
||||||
|
import android.text.SpannableString
|
||||||
|
import android.graphics.Color
|
||||||
|
import kotlinx.android.synthetic.main.content_product.*
|
||||||
|
import me.gilo.wc.R
|
||||||
|
import me.gilo.wc.ui.coupon.CouponActivity
|
||||||
|
import me.gilo.wc.ui.product.ProductActivity
|
||||||
|
|
||||||
|
|
||||||
class ProductViewHolder(val context: Context, itemView: View) :
|
class ProductViewHolder(val context: Context, itemView: View) :
|
||||||
RecyclerView.ViewHolder(itemView) {
|
RecyclerView.ViewHolder(itemView) {
|
||||||
@ -18,14 +27,35 @@ class ProductViewHolder(val context: Context, itemView: View) :
|
|||||||
val tvTitle = itemView.findViewById<TextView>(R.id.tvTitle)
|
val tvTitle = itemView.findViewById<TextView>(R.id.tvTitle)
|
||||||
val tvDescription = itemView.findViewById<TextView>(R.id.tvDescription)
|
val tvDescription = itemView.findViewById<TextView>(R.id.tvDescription)
|
||||||
val tvCallToAction = itemView.findViewById<TextView>(R.id.tvCallToAction)
|
val tvCallToAction = itemView.findViewById<TextView>(R.id.tvCallToAction)
|
||||||
|
val tvOnSale = itemView.findViewById<TextView>(R.id.tvOnSale)
|
||||||
|
|
||||||
tvTitle.text = product.name
|
tvTitle.text = product.name
|
||||||
tvDescription.text = Html.fromHtml(product.description)
|
tvDescription.text = Html.fromHtml(product.description)
|
||||||
tvCallToAction.text = Html.fromHtml(product.price_html)
|
|
||||||
|
|
||||||
if (product.images != null && product.images.isNotEmpty()){
|
if (product.images != null && product.images.isNotEmpty()){
|
||||||
Picasso.with(context).load(product.images[0].src).into(ivImage)
|
Picasso.with(context).load(product.images[0].src).into(ivImage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val regularPrice = product.regular_price
|
||||||
|
val salePrice = product.sale_price
|
||||||
|
|
||||||
|
val price = SpannableString("$$regularPrice $$salePrice")
|
||||||
|
if (product.isOn_sale) {
|
||||||
|
tvCallToAction.text = Html.fromHtml(product.price_html)
|
||||||
|
|
||||||
|
tvOnSale.visibility = View.VISIBLE
|
||||||
|
}else{
|
||||||
|
tvCallToAction.text = Html.fromHtml(product.price_html)
|
||||||
|
tvOnSale.visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
|
itemView.setOnClickListener{
|
||||||
|
val intent = Intent(context, ProductActivity::class.java)
|
||||||
|
intent.putExtra("productId", product.id)
|
||||||
|
|
||||||
|
context.startActivity(intent)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,10 @@ import android.annotation.SuppressLint;
|
|||||||
import android.arch.lifecycle.ViewModel;
|
import android.arch.lifecycle.ViewModel;
|
||||||
import android.arch.lifecycle.ViewModelProvider;
|
import android.arch.lifecycle.ViewModelProvider;
|
||||||
import android.arch.lifecycle.ViewModelProviders;
|
import android.arch.lifecycle.ViewModelProviders;
|
||||||
|
import android.content.Context;
|
||||||
import dagger.android.support.DaggerAppCompatActivity;
|
import dagger.android.support.DaggerAppCompatActivity;
|
||||||
|
import io.github.inflationx.viewpump.ViewPumpContextWrapper;
|
||||||
|
import me.gilo.wc.ui.state.ProgressDialogFragment;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
@ -22,4 +25,9 @@ public class BaseActivity extends DaggerAppCompatActivity {
|
|||||||
public <T extends ViewModel> T getViewModel(final Class<T> cls) {
|
public <T extends ViewModel> T getViewModel(final Class<T> cls) {
|
||||||
return ViewModelProviders.of(this, viewModelFactory).get(cls);
|
return ViewModelProviders.of(this, viewModelFactory).get(cls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void attachBaseContext(Context newBase) {
|
||||||
|
super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package me.gilo.wc.di;
|
|||||||
import dagger.Module;
|
import dagger.Module;
|
||||||
import dagger.android.ContributesAndroidInjector;
|
import dagger.android.ContributesAndroidInjector;
|
||||||
import me.gilo.wc.MainActivity;
|
import me.gilo.wc.MainActivity;
|
||||||
|
import me.gilo.wc.ui.product.ProductActivity;
|
||||||
import me.gilo.wc.ui.product.ShopActivity;
|
import me.gilo.wc.ui.product.ShopActivity;
|
||||||
|
|
||||||
@Module
|
@Module
|
||||||
@ -14,4 +15,7 @@ abstract class ActivitiesModule {
|
|||||||
@ContributesAndroidInjector
|
@ContributesAndroidInjector
|
||||||
abstract ShopActivity contributesShopActivity();
|
abstract ShopActivity contributesShopActivity();
|
||||||
|
|
||||||
|
@ContributesAndroidInjector
|
||||||
|
abstract ProductActivity contributesProductActivity();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,14 @@ public class ProductRepository extends WoocommerceRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public WooLiveData<Product> product(int productId) {
|
||||||
|
final WooLiveData<Product> callBack = new WooLiveData();
|
||||||
|
|
||||||
|
woocommerce.ProductRepository().product(productId).enqueue(callBack);
|
||||||
|
return callBack;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public WooLiveData<List<Product>> search(String term) {
|
public WooLiveData<List<Product>> search(String term) {
|
||||||
final WooLiveData<List<Product>> callBack = new WooLiveData();
|
final WooLiveData<List<Product>> callBack = new WooLiveData();
|
||||||
|
|
||||||
|
|||||||
107
app/src/main/java/me/gilo/wc/ui/product/ProductActivity.kt
Normal file
107
app/src/main/java/me/gilo/wc/ui/product/ProductActivity.kt
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
package me.gilo.wc.ui.product
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.support.design.widget.Snackbar
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.text.Html
|
||||||
|
import android.text.Spannable
|
||||||
|
import android.text.SpannableString
|
||||||
|
import android.text.style.ForegroundColorSpan
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.ImageView
|
||||||
|
import android.widget.TextView
|
||||||
|
import com.squareup.picasso.Picasso
|
||||||
|
import me.gilo.wc.R
|
||||||
|
|
||||||
|
import kotlinx.android.synthetic.main.activity_product.*
|
||||||
|
import kotlinx.android.synthetic.main.content_product.*
|
||||||
|
import me.gilo.wc.common.BaseActivity
|
||||||
|
import me.gilo.wc.common.Status
|
||||||
|
import me.gilo.wc.ui.state.ProgressDialogFragment
|
||||||
|
import me.gilo.wc.viewmodels.ProductViewModel
|
||||||
|
import me.gilo.woodroid.models.Product
|
||||||
|
|
||||||
|
class ProductActivity : BaseActivity() {
|
||||||
|
|
||||||
|
lateinit var viewModel: ProductViewModel
|
||||||
|
val TAG = this::getLocalClassName
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
setContentView(R.layout.activity_product)
|
||||||
|
setSupportActionBar(toolbar)
|
||||||
|
|
||||||
|
viewModel = getViewModel(ProductViewModel::class.java)
|
||||||
|
|
||||||
|
title = "Product"
|
||||||
|
|
||||||
|
val productId = intent.getIntExtra("productId", 0)
|
||||||
|
|
||||||
|
if (productId != 0){
|
||||||
|
product(productId)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun product(productId : Int) {
|
||||||
|
viewModel.product(productId).observe(this, android.arch.lifecycle.Observer { response ->
|
||||||
|
when (response!!.status()) {
|
||||||
|
Status.LOADING -> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Status.SUCCESS -> {
|
||||||
|
val product = response.data()
|
||||||
|
setUpPage(product)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Status.ERROR -> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Status.EMPTY -> {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setUpPage(product: Product) {
|
||||||
|
tvTitle.text = product.name
|
||||||
|
tvDescription.text = Html.fromHtml(product.description)
|
||||||
|
|
||||||
|
if (product.images != null && product.images.isNotEmpty()){
|
||||||
|
Picasso.with(baseContext).load(product.images[0].src).into(ivImage)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (product.isOn_sale) {
|
||||||
|
tvCallToAction.text = Html.fromHtml(product.price_html)
|
||||||
|
|
||||||
|
tvOnSale.visibility = View.VISIBLE
|
||||||
|
}else{
|
||||||
|
tvCallToAction.text = Html.fromHtml(product.price_html)
|
||||||
|
tvOnSale.visibility = View.GONE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private lateinit var progressDialog: ProgressDialogFragment
|
||||||
|
|
||||||
|
fun showLoading(title: String, message: String) {
|
||||||
|
val manager = supportFragmentManager
|
||||||
|
progressDialog = ProgressDialogFragment.newInstance(title, message)
|
||||||
|
progressDialog.isCancelable = false
|
||||||
|
progressDialog.show(manager, "progress")
|
||||||
|
}
|
||||||
|
|
||||||
|
fun showLoading() {
|
||||||
|
showLoading("This will only take a sec", "Loading")
|
||||||
|
}
|
||||||
|
|
||||||
|
fun stopShowingLoading() {
|
||||||
|
progressDialog.dismiss()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -21,6 +21,10 @@ public final class ProductViewModel extends ViewModel {
|
|||||||
return productRepository.products();
|
return productRepository.products();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public WooLiveData<Product> product(int productId) {
|
||||||
|
return productRepository.product(productId);
|
||||||
|
}
|
||||||
|
|
||||||
public WooLiveData<List<Product>> search(String term) {
|
public WooLiveData<List<Product>> search(String term) {
|
||||||
return productRepository.search(term);
|
return productRepository.search(term);
|
||||||
}
|
}
|
||||||
|
|||||||
34
app/src/main/res/layout/activity_product.xml
Normal file
34
app/src/main/res/layout/activity_product.xml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.design.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=".ui.product.ProductActivity">
|
||||||
|
|
||||||
|
<android.support.design.widget.AppBarLayout
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:theme="@style/AppTheme.AppBarOverlay">
|
||||||
|
|
||||||
|
<android.support.v7.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>
|
||||||
|
|
||||||
|
<include layout="@layout/content_product"/>
|
||||||
|
|
||||||
|
<android.support.design.widget.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"
|
||||||
|
app:srcCompat="@android:drawable/ic_dialog_email"/>
|
||||||
|
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
103
app/src/main/res/layout/content_product.xml
Normal file
103
app/src/main/res/layout/content_product.xml
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout 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"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:background="@color/bg"
|
||||||
|
android:elevation="2dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:ignore="MissingPrefix"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
|
>
|
||||||
|
|
||||||
|
<android.support.v4.widget.NestedScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/rect_white"
|
||||||
|
android:elevation="2dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:ignore="MissingPrefix">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="200dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivImage"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvOnSale"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="top|left"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:textColor="#ffffff"
|
||||||
|
android:text="SALE!"
|
||||||
|
fontPath="@string/font_medium"
|
||||||
|
android:padding="8dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTitle"
|
||||||
|
fontPath="@string/font_medium"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:gravity="left"
|
||||||
|
android:textColor="@color/text"
|
||||||
|
android:textSize="18sp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvDescription"
|
||||||
|
fontPath="@string/font_regular"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:gravity="left"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:lineSpacingMultiplier="1.2"
|
||||||
|
android:textColor="@color/text_black_5"
|
||||||
|
android:textSize="14sp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvCallToAction"
|
||||||
|
fontPath="@string/font_regular"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right"
|
||||||
|
android:layout_marginRight="0dp"
|
||||||
|
android:layout_marginBottom="0dp"
|
||||||
|
android:gravity="left"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:textColor="#1c5c9a"
|
||||||
|
android:textSize="14sp"/>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</android.support.v4.widget.NestedScrollView>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
@ -1,62 +1,80 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginRight="8dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:background="@drawable/rect_white"
|
android:background="@drawable/rect_white"
|
||||||
android:elevation="2dp"
|
android:elevation="2dp"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
tools:ignore="MissingPrefix">
|
tools:ignore="MissingPrefix">
|
||||||
|
|
||||||
<ImageView
|
<FrameLayout
|
||||||
android:id="@+id/ivImage"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="200dp">
|
||||||
android:layout_height="200dp"
|
|
||||||
android:scaleType="centerCrop"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:id="@+id/tvTitle"
|
android:id="@+id/ivImage"
|
||||||
fontPath="@string/font_medium"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:scaleType="centerCrop"
|
||||||
android:layout_marginLeft="16dp"
|
/>
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:layout_marginRight="16dp"
|
|
||||||
android:gravity="left"
|
|
||||||
android:textColor="@color/text"
|
|
||||||
android:textSize="18sp" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvDescription"
|
android:id="@+id/tvOnSale"
|
||||||
fontPath="@string/font_regular"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_gravity="top|left"
|
||||||
android:layout_marginLeft="16dp"
|
android:background="@color/colorPrimary"
|
||||||
android:layout_marginTop="8dp"
|
android:textColor="#ffffff"
|
||||||
android:layout_marginRight="16dp"
|
android:text="SALE!"
|
||||||
android:gravity="left"
|
fontPath="@string/font_medium"
|
||||||
android:maxLines="2"
|
android:padding="8dp"
|
||||||
android:lineSpacingMultiplier="1.2"
|
/>
|
||||||
android:textColor="@color/text_black_5"
|
|
||||||
android:textSize="14sp" />
|
|
||||||
|
|
||||||
<TextView
|
</FrameLayout>
|
||||||
android:id="@+id/tvCallToAction"
|
|
||||||
fontPath="@string/font_regular"
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/tvTitle"
|
||||||
android:layout_height="wrap_content"
|
fontPath="@string/font_medium"
|
||||||
android:layout_gravity="right"
|
android:layout_width="wrap_content"
|
||||||
android:layout_marginRight="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="0dp"
|
android:layout_marginLeft="16dp"
|
||||||
android:gravity="left"
|
android:layout_marginTop="16dp"
|
||||||
android:padding="16dp"
|
android:layout_marginRight="16dp"
|
||||||
android:textColor="#1c5c9a"
|
android:gravity="left"
|
||||||
android:textSize="14sp" />
|
android:textColor="@color/text"
|
||||||
|
android:textSize="18sp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvDescription"
|
||||||
|
fontPath="@string/font_regular"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:gravity="left"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:lineSpacingMultiplier="1.2"
|
||||||
|
android:textColor="@color/text_black_5"
|
||||||
|
android:textSize="14sp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvCallToAction"
|
||||||
|
fontPath="@string/font_regular"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right"
|
||||||
|
android:layout_marginRight="0dp"
|
||||||
|
android:layout_marginBottom="0dp"
|
||||||
|
android:gravity="left"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:textColor="#1c5c9a"
|
||||||
|
android:textSize="14sp"/>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<dimen name="fab_margin">16dp</dimen>
|
<dimen name="fab_margin">16dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@ -1,17 +1,18 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">wc-app</string>
|
<string name="app_name">wc-app</string>
|
||||||
<string name="title_activity_shop">ShopActivity</string>
|
<string name="title_activity_shop">ShopActivity</string>
|
||||||
<string name="title_activity_coupon">CouponActivity</string>
|
<string name="title_activity_coupon">CouponActivity</string>
|
||||||
<string name="title_activity_menu">MenuActivity</string>
|
<string name="title_activity_menu">MenuActivity</string>
|
||||||
|
|
||||||
|
|
||||||
<string name="font_bold">fonts/GT-America-Bold.otf</string>
|
<string name="font_bold">fonts/GT-America-Bold.otf</string>
|
||||||
<string name="font_medium">fonts/GT-America-Medium.otf</string>
|
<string name="font_medium">fonts/GT-America-Medium.otf</string>
|
||||||
<string name="font_regular">fonts/GT-America-Regular.otf</string>
|
<string name="font_regular">fonts/GT-America-Regular.otf</string>
|
||||||
<string name="title_activity_add_coupon">AddCouponActivity</string>
|
<string name="title_activity_add_coupon">AddCouponActivity</string>
|
||||||
<string name="title_activity_coupons">CouponsActivity</string>
|
<string name="title_activity_coupons">CouponsActivity</string>
|
||||||
<string name="search_title">search</string>
|
<string name="search_title">search</string>
|
||||||
<string name="search_hint">Search product</string>
|
<string name="search_hint">Search product</string>
|
||||||
<string name="title_activity_product_search">ProductSearchActivity</string>
|
<string name="title_activity_product_search">ProductSearchActivity</string>
|
||||||
|
<string name="title_activity_product">ProductActivity</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@ -1,20 +1,20 @@
|
|||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
<item name="colorAccent">@color/colorAccent</item>
|
<item name="colorAccent">@color/colorAccent</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="AppTheme.NoActionBar">
|
<style name="AppTheme.NoActionBar">
|
||||||
<item name="windowActionBar">false</item>
|
<item name="windowActionBar">false</item>
|
||||||
<item name="windowNoTitle">true</item>
|
<item name="windowNoTitle">true</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
|
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
|
||||||
|
|
||||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
|
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user