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