импорт android.os.Parcel; импорт android.os.Parcelable; общественный класс
HomeFeatureProductListModel реализует Parcelable {
public static final Creator<HomeFeatureProductListModel> CREATOR = new Creator<HomeFeatureProductListModel>() {
@Override
public HomeFeatureProductListModel createFromParcel(Parcel in) {
return new HomeFeatureProductListModel(in);
}
@Override
public HomeFeatureProductListModel[] newArray(int size) {
return new HomeFeatureProductListModel[size];
}
};
private long ProductID;
private String ProductName;
private String ShortDescription;
private Long Price1;
private Long Price2;
private Long StrikePrice1;
private Long StrikePrice2;
private String Slug;
private int SiteVisitorWishListID;
private String FullImagePath;
private String ProductUrl;
public HomeFeatureProductListModel() {
}
protected HomeFeatureProductListModel(Parcel in) {
ProductID = in.readLong();
ProductName = in.readString();
ShortDescription = in.readString();
Price1 = in.readLong();
Price2 = in.readLong();
StrikePrice1 = in.readLong();
StrikePrice2 = in.readLong();
Slug = in.readString();
SiteVisitorWishListID = in.readInt();
FullImagePath = in.readString();
ProductUrl = in.readString();
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeLong(ProductID);
dest.writeString(ProductName);
dest.writeString(ShortDescription);
dest.writeLong(Price1);
dest.writeLong(Price2);
dest.writeLong(StrikePrice1);
dest.writeLong(StrikePrice2);
dest.writeString(Slug);
dest.writeInt(SiteVisitorWishListID);
dest.writeString(FullImagePath);
dest.writeString(ProductUrl);
}
@Override
public int describeContents() {
return 0;
}
public long getProductID() {
return ProductID;
}
public void setProductID(long productID) {
ProductID = productID;
}
public String getProductName() {
return ProductName;
}
public void setProductName(String productName) {
ProductName = productName;
}
public String getShortDescription() {
return ShortDescription;
}
public void setShortDescription(String shortDescription) {
ShortDescription = shortDescription;
}
public Long getPrice1() {
return Price1;
}
public void setPrice1(Long price1) {
Price1 = price1;
}
public String getPrice1New() {
String sss = "₹ " + String.valueOf(Price1);
return sss;
}
public Long getPrice2() {
return Price2;
}
public void setPrice2(Long price2) {
Price2 = price2;
}
public Long getStrikePrice1() {
return StrikePrice1;
}
public void setStrikePrice1(Long strikePrice1) {
StrikePrice1 = strikePrice1;
}
public Long getStrikePrice2() {
return StrikePrice2;
}
public void setStrikePrice2(Long strikePrice2) {
StrikePrice2 = strikePrice2;
}
public String getSlug() {
return Slug;
}
public void setSlug(String slug) {
Slug = slug;
}
public int getSiteVisitorWishListID() {
return SiteVisitorWishListID;
}
public void setSiteVisitorWishListID(int siteVisitorWishListID) {
SiteVisitorWishListID = siteVisitorWishListID;
}
public String getFullImagePath() {
return FullImagePath;
}
public void setFullImagePath(String fullImagePath) {
FullImagePath = fullImagePath;
}
public String getProductUrl() {
return ProductUrl;
}
public void setProductUrl(String productUrl) {
ProductUrl = productUrl;
} }
применить плагин: 'com.android.application'
андроид {
compileSdkVersion 28
defaultConfig {
applicationId "com.mca.craftisans"
minSdkVersion 16
targetSdkVersion 28
versionCode 3
versionName "1.0.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildConfigField "boolean", "ALLOW_DATABASE", "false"
multiDexEnabled true
flavorDimensions "server"
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath = true
}
}
}
dataBinding {
enabled = true
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
debug {
signingConfig signingConfigs.kaira
minifyEnabled false
buildConfigField "boolean", "ALLOW_DATABASE", "true"
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
signingConfig signingConfigs.kaira
minifyEnabled false
buildConfigField "boolean", "ALLOW_DATABASE", "false"
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
} }
ext {
supportLibVersion = '25.2.0'
playServiceLibVersion = '9.6.1'
}
зависимости {
реализация 'com.android.support.constraint: компоновка ограничений: 1.1.2'
реализация fileTree (включает: ['* .jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
implementation 'io.reactivex.rxjava2:rxjava:2.1.9'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'com.jakewharton.rxbinding2:rxbinding-recyclerview-v7:2.0.0'
implementation 'com.jakewharton.rxbinding2:rxbinding-support-v4:2.0.0'
implementation 'com.jakewharton.rxbinding2:rxbinding-appcompat-v7:2.0.0'
implementation 'com.jakewharton.rxbinding2:rxbinding-design:2.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.0.2'
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
implementation 'com.squareup.okhttp3:logging-interceptor:3.2.0'
implementation 'com.google.code.gson:gson:2.3'
} применить плагин: 'com.google.gms.google-services'