Skip to content

Commit

Permalink
Merge branch 'Require-Profile-2-' into home
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenht65 committed Feb 21, 2022
2 parents 6917465 + cb7c8a8 commit c0313d3
Show file tree
Hide file tree
Showing 26 changed files with 898 additions and 157 deletions.
4 changes: 2 additions & 2 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {

defaultConfig {
applicationId "fu.prm391.sampl.project"
minSdk 29
minSdk 28
targetSdk 32
versionCode 1
versionName "1.0"
Expand Down Expand Up @@ -45,7 +45,11 @@ dependencies {
implementation 'androidx.navigation:navigation-fragment:2.4.1'
implementation 'androidx.navigation:navigation-ui:2.4.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.gms:play-services-cast-framework:20.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'


implementation 'com.github.dhaval2404:imagepicker:2.1'
}
8 changes: 8 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
package="fu.prm391.sampl.project">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />

<application
android:requestLegacyExternalStorage="true"
android:allowBackup="true"
android:icon="@drawable/app_icon"
android:label="@string/app_name"
Expand All @@ -20,6 +25,9 @@
<activity
android:name=".view.category.SpecifyCategory"
android:exported="false" />
<activity
android:name=".view.profiles.EditProfiles"
android:exported="false" />
<activity
android:name=".view.address.CreateNewAddress"
android:exported="false" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import java.util.List;

import fu.prm391.sampl.project.model.product.Product;

public class ProductResponse {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package fu.prm391.sampl.project.model.user;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

public class UpdateUserInfoRequest {
@SerializedName("firstName")
@Expose
private String firstName;
@SerializedName("lastName")
@Expose
private String lastName;
@SerializedName("gender")
@Expose
private int gender;
@SerializedName("phone")
@Expose
private String phone;
@SerializedName("image")
@Expose
private String image;

public UpdateUserInfoRequest() {
}

public UpdateUserInfoRequest(String firstName, String lastName, int gender, String phone, String image) {
this.firstName = firstName;
this.lastName = lastName;
this.gender = gender;
this.phone = phone;
this.image = image;
}

public String getFirstName() {
return firstName;
}

public void setFirstName(String firstName) {
this.firstName = firstName;
}

public String getLastName() {
return lastName;
}

public void setLastName(String lastName) {
this.lastName = lastName;
}

public int getGender() {
return gender;
}

public void setGender(int gender) {
this.gender = gender;
}

public String getPhone() {
return phone;
}

public void setPhone(String phone) {
this.phone = phone;
}

public String getImage() {
return image;
}

public void setImage(String image) {
this.image = image;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package fu.prm391.sampl.project.model.user;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

public class UpdateUserInfoResponse {

@SerializedName("message")
@Expose
private String message;

public String getMessage() {
return message;
}

public void setMessage(String message) {
this.message = message;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

public class User {
import java.io.Serializable;

public class User implements Serializable {
@SerializedName("id")
@Expose
private int id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import fu.prm391.sampl.project.model.product.get_list_product.ProductListResponse;
import fu.prm391.sampl.project.model.product.get_product_by_id.ProductResponse;

import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package fu.prm391.sampl.project.remote.service;

import fu.prm391.sampl.project.model.user.UpdateUserInfoRequest;
import fu.prm391.sampl.project.model.user.UpdateUserInfoResponse;
import fu.prm391.sampl.project.model.user.forgot_password.ForgotPassRequest;
import fu.prm391.sampl.project.model.user.forgot_password.ForgotPassResponse;
import fu.prm391.sampl.project.model.user.login.LoginRequest;
Expand All @@ -15,6 +16,7 @@
import retrofit2.http.Header;
import retrofit2.http.PATCH;
import retrofit2.http.POST;
import retrofit2.http.PUT;

public interface UserService {

Expand All @@ -32,4 +34,8 @@ public interface UserService {

@GET("user/get-user-info")
Call<UserResponse> getUserInformation(@Header("Authorization") String token);

@PUT("user/update-information")
Call<UpdateUserInfoResponse> updateUserInformation(@Header("Authorization") String token,
@Body UpdateUserInfoRequest updateUserInfoRequest);
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
return view;
}



private void getTop4Category(View view) {
recyclerViewTop4Category = view.findViewById(R.id.recyclerViewTop4Cate);
Call<CategoryResponse> categoryResponseCall = ApiClient.getCategoryService().getTop4Categories();
Expand Down
Loading

0 comments on commit c0313d3

Please sign in to comment.