Commit 45f156a2 authored by Ahmad Abi Mulya's avatar Ahmad Abi Mulya

add confirm password in register, fix unconcistance language

parent e5617de2
......@@ -5,6 +5,7 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.room.FtsOptions;
import android.Manifest;
......@@ -95,6 +96,10 @@ public class MainActivity extends AppCompatActivity {
overridePendingTransition(0, 0);
return true;
case R.id.item_three:
startActivity(new Intent(MainActivity.this, OrderActivity.class));
finish();
break;
case R.id.item_four:
prefManager.removeLoginSession();
startActivity(new Intent(MainActivity.this, LoginActivity.class));
finish();
......
......@@ -40,6 +40,8 @@ public class RegisterActivity extends AppCompatActivity {
binding.etPassword.setError("Passwords can only contain Alphanumeric");
}else if(binding.etPassword.getText().toString().length() < 8) {
binding.etPassword.setError("Password length cannot be less than 8 characters");
}else if(binding.etPassword.getText().toString() != binding.etConfirmPassword.getText().toString()){
binding.etConfirmPassword.setError("Password doesn't match!");
}else {
user.setEmail(binding.etEmail.getText().toString());
user.setFullName(binding.etUsername.getText().toString());
......
......@@ -21,7 +21,7 @@
app:layout_constraintVertical_bias="0.105" />
<com.google.android.material.button.MaterialButton
android:id="@+id/btnPending"
android:layout_width="190dp"
android:layout_width="160dp"
android:layout_height="wrap_content"
android:text="PENDING"
android:textSize="10dp"
......@@ -34,7 +34,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/btnSuccess"
android:layout_width="190dp"
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:text="SUCCESS"
......
......@@ -64,7 +64,7 @@
android:id="@+id/etProduct"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Nama produk"
android:hint="Product Name"
android:text="@{viewModel.product.name}"
android:inputType="textCapWords"
android:textSize="@dimen/text_default" />
......@@ -85,7 +85,7 @@
android:id="@+id/etPrice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Harga"
android:hint="Price"
android:text="@{viewModel.product.price == 0 ? `` : viewModel.product.price + ``}"
android:inputType="number"
android:textSize="@dimen/text_default" />
......@@ -107,7 +107,7 @@
android:id="@+id/etQuantity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Jumlah"
android:hint="Qty"
android:text="@{viewModel.product.quantity == 0 ? `` : viewModel.product.quantity + ``}"
android:inputType="number"
android:textSize="@dimen/text_default" />
......@@ -124,7 +124,7 @@
android:layout_marginEnd="@dimen/space_default">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/etCategory"
android:hint="Categori"
android:hint="Category"
android:text="@{viewModel.product.category}"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
......@@ -144,7 +144,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start|top"
android:hint="Deskripsi produk"
android:hint="Product Description"
android:inputType="textMultiLine"
android:lines="3"
android:maxLines="3"
......
......@@ -3,9 +3,9 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
</data>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
......@@ -109,6 +109,28 @@
android:textSize="@dimen/text_default" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilConfirmPassword"
app:passwordToggleEnabled="true"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/tilPassword"
android:layout_marginTop="20dp"
android:layout_marginStart="@dimen/space_default"
android:layout_marginEnd="@dimen/space_default"
android:layout_marginBottom="@dimen/space_default">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/etConfirmPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Confirm Password"
android:inputType="textPassword"
android:imeOptions="actionNext"
android:textSize="@dimen/text_default" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvDescSk"
android:layout_width="wrap_content"
......@@ -118,7 +140,7 @@
android:text="By registering you have agreed to the"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tilPassword" />
app:layout_constraintTop_toBottomOf="@id/tilConfirmPassword" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvSK"
......@@ -161,9 +183,10 @@
android:id="@+id/tvDontHaveAnAccount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="75dp"
android:layout_marginStart="85dp"
android:layout_marginTop="15dp"
android:text="@string/dont_have_an_account"
android:layout_marginBottom="15dp"
android:text="Have an Account? "
app:layout_constraintEnd_toStartOf="@id/tvSignInHere"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnRegister" />
......@@ -175,9 +198,11 @@
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:text="@string/sign_in_here"
android:textColor="@color/blue"
app:layout_constraintStart_toEndOf="@id/tvDontHaveAnAccount"
app:layout_constraintTop_toBottomOf="@id/btnRegister" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</layout>
\ No newline at end of file
......@@ -8,5 +8,8 @@
android:title="Update / Delete Product"/>
<item
android:id="@+id/item_three"
android:title="Transaction List"/>
<item
android:id="@+id/item_four"
android:title="Log Out"/>
</menu>
\ No newline at end of file
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