Commit d7548879 authored by iman Fauzi's avatar iman Fauzi

fix conflict

parents 635ee289 d365a966
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
......@@ -21,6 +21,7 @@
android:roundIcon="@mipmap/ic_launcher_new_icon"
android:supportsRtl="true"
android:theme="@style/AppTheme.appbar">
<activity android:name=".RegisterActivity"></activity>
<activity
android:name=".BottomSheets"
tools:ignore="Instantiatable" />
......
......@@ -188,7 +188,8 @@ public class FormProductActivity extends AppCompatActivity {
HashSet<String> set = new HashSet<>();
List<String> str = new ArrayList<>();
categoryModels = new ArrayList<>();
if (productModelsIntent == null){
Log.i("GET_CATEGORY", "setSpinner: "+utils.convertGson(productModelsIntent));
if (productModelsIntent.getCategoryProduct() == 0){
str.add("SELECT CATEGORY");
}else{
str.add(getCategoryById(productModelsIntent.getIdProduct()));
......@@ -337,11 +338,11 @@ public class FormProductActivity extends AppCompatActivity {
}
private String getCategoryById(int s) {
CategoryServise categoryServise = client.Client(CategoryServise.class);
categoryServise.getCategoryId(s).enqueue(new Callback<DataResponse<CategoryModels>>() {
@Override
public void onResponse(Call<DataResponse<CategoryModels>> call, Response<DataResponse<CategoryModels>> response) {
Log.i("ER", "onResponse: "+utils.convertGson(response.body()));
categoryName = response.body().getData().getNameCategory();
}
......
......@@ -39,9 +39,9 @@ public class LoginActivity extends AppCompatActivity {
Utils utils = new Utils();
LoginState loginState;
MaterialButton btnSignIn;
ConstraintLayout loginSheetLayout;
BottomSheetBehavior sheetBehavior;
MaterialButton btnSignup, btnSignIn;
ConstraintLayout loginSheetLayout, registerSheetLayout;
BottomSheetBehavior sheetBehavior,sheetBehavior2;
int height, width;
ImageButton closeBtn;
......@@ -62,6 +62,96 @@ public class LoginActivity extends AppCompatActivity {
// bindUI
btnSignIn = findViewById(R.id.signInButtonDashboardLogin);
// get window height
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
height = displayMetrics.heightPixels;
width = displayMetrics.widthPixels;
// get bottom sheets
sheetBehavior = BottomSheetBehavior.from(loginSheetLayout);
sheetBehavior2 = BottomSheetBehavior.from(registerSheetLayout);
// button on click to form login
btnSignIn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (sheetBehavior.getState() != BottomSheetBehavior.STATE_EXPANDED) {
sheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
loginSheetLayout.setMaxHeight(height - 100);
} else {
sheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
}
}
});
//button on click to form register
btnSignup.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (sheetBehavior2.getState() != BottomSheetBehavior.STATE_EXPANDED) {
sheetBehavior2.setState(BottomSheetBehavior.STATE_EXPANDED);
registerSheetLayout.setMaxHeight(height - 100);
} else {
sheetBehavior2.setState(BottomSheetBehavior.STATE_COLLAPSED);
}
}
});
/*
* LOGIN LOGIKA DIBAWAH INI
* */
//<<<<<<< HEAD
// public void onClick(View v) {
// Snackbar snackbar = Snackbar.make(v, "Oppss! Wrong Username Or Password!", Snackbar.LENGTH_LONG);
//
// if (TextUtils.isEmpty(username.getText().toString()) &&
// TextUtils.isEmpty(password.getText().toString())){
// username.setError("This field can't empty");
// password.setError("This field can't empty");
// }else if (TextUtils.isEmpty(username.getText().toString())){
// username.setError("This field can't empty");
// }else if (TextUtils.isEmpty(password.getText().toString())){
// password.setError("This field can't empty");
// }else{
// progressBar.setVisibility(View.VISIBLE);
// username.setEnabled(false);
// password.setEnabled(false);
// btnLogin.setEnabled(false);
//
// mainViewModels.checkLogin(new UsersModels(username.getText().toString(),
// password.getText().toString())).observe(LoginActivity.this, new Observer<DataResponse<UsersModels>>() {
// @Override
// public void onChanged(DataResponse<UsersModels> usersModelsDataResponse) {
// Log.d("Status", usersModelsDataResponse.getMessageData());
//
// if (usersModelsDataResponse != null){
// if (usersModelsDataResponse.getStatusData()){
// SharedPreferences.Editor editor = sharedPreferences.edit();
// editor.putBoolean(SplashScreen.SESSION, true);
// editor.commit();
//
// startActivity(new Intent(LoginActivity.this, MainActivity.class));
//
// progressBar.setVisibility(View.GONE);
// username.setEnabled(true);
// password.setEnabled(true);
// btnLogin.setEnabled(true);
// }else {
// utils.snackBar(v,"Oppss! Wrong Username Or Password!").show();
// progressBar.setVisibility(View.GONE);
// username.setEnabled(true);
// password.setEnabled(true);
// btnLogin.setEnabled(true);
// }
// }else{
// utils.snackBar(v, "Oppss! ログイン中にエラーが発生しました。しばらくしてからもう一度お試しください").show();
// }
//
// }
// });
//=======
// session login
sharedPreferences = getSharedPreferences(SplashScreen.MY_SHARED_PREFERENCES, Context.MODE_PRIVATE);
......
......@@ -101,7 +101,6 @@ public class MainActivity extends AppCompatActivity {
showLoading(true);
btnAddCart = findViewById(R.id.materialBtnAddCart);
binding.tvCategory.setVisibility(View.GONE);
binding.tvProduct.setVisibility(View.GONE);
formCategory = new FormCategory();
......@@ -200,7 +199,6 @@ public class MainActivity extends AppCompatActivity {
categoryModels.add(0,caModels);
categoryModelsArrayList.addAll(categoryModels);
binding.tvCategory.setVisibility(View.VISIBLE);
binding.tvProduct.setVisibility(View.VISIBLE);
categoryAdapter.setCategoriAdapter(MainActivity.this, categoryModelsArrayList);
binding.rvCategory.setLayoutManager(new LinearLayoutManager(
......
package com.yono.messeripos;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class RegisterActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
}
}
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@color/colorPrimary"
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>
......@@ -122,6 +122,16 @@
app:layout_constraintVertical_bias="0.01999998" />
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="forgot your password ?"
android:layout_marginLeft="100sp"
android:textColor="@color/colorWhite"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnLogin" />
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
......
......@@ -50,22 +50,15 @@
</com.google.android.material.appbar.AppBarLayout>
<TextView
android:id="@+id/tvCategory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/topBar"
android:textColor="@android:color/black"
android:textSize="18sp"
android:textAllCaps="true"
android:layout_margin="5dp"
android:text="Category"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvCategory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tvCategory"/>
android:layout_below="@+id/topBar"
android:layout_alignParentEnd="true"
android:paddingTop="10dp"
android:layout_marginEnd="0dp" />
<ImageView
android:id="@+id/imgEmpty"
......@@ -95,8 +88,7 @@
android:textColor="@android:color/black"
android:textSize="18sp"
android:textAllCaps="true"
android:layout_margin="5dp"
android:text="Product"/>
android:layout_margin="5dp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvProduct"
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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=".RegisterActivity">
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -20,6 +20,7 @@
android:layout_height="wrap_content"
android:drawableStart="@drawable/ic_baseline_search_24"
android:hint="Search"
android:textStyle="normal"
android:outlineSpotShadowColor="#fff"
android:paddingStart="10dp"
android:textColor="#fff"
......
......@@ -39,11 +39,12 @@
app:strokeColor="#fff"
android:text="sign up"
android:textStyle="bold"
android:textColor="#fff"
android:textColor="@color/colorWhite"
app:strokeWidth="2dp"
app:rippleColor="@color/colorWhite"
android:padding="20dp"
app:cornerRadius="5dp"
android:background="@color/colorPrimaryCenter"
android:layout_above="@id/signInButtonDashboardLogin"
android:layout_marginBottom="10dp"/>
......
......@@ -59,26 +59,28 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/categoryDelete"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="40dp"
android:backgroundTint="@android:color/holo_red_dark"
android:text="DELETE"
android:textSize="10sp"
android:textAlignment="textStart"
app:layout_constraintTop_toBottomOf="@id/cvCategory"
android:backgroundTint="@android:color/holo_red_dark"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cvCategory"
app:layout_constraintVertical_bias="0.0" />
<com.google.android.material.button.MaterialButton
android:id="@+id/categoryUpdate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="40dp"
android:backgroundTint="@color/colorGreen"
android:text="UPDATE"
android:textSize="10sp"
android:textAlignment="textEnd"
app:layout_constraintTop_toBottomOf="@id/cvCategory"
android:backgroundTint="@color/colorGreen"
android:textSize="10sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/cvCategory"
app:layout_constraintVertical_bias="0.0" />
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
......
......@@ -2,6 +2,7 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
......@@ -105,4 +106,3 @@
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>
\ No newline at end of file
This diff is collapsed.
......@@ -28,6 +28,7 @@
<string name="title_next">next</string>
<string name="open_cart">Open Cart</string>
<string name="text_new_category">Add New Category</string>
<string name="email">Email</string>
<string-array name="planets_array">
<item>Mercury</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment