Commit 65267ae4 authored by Ahmad Abi Mulya's avatar Ahmad Abi Mulya

remove econflict merging

parents b8359bf1 f6fae203
...@@ -32,9 +32,10 @@ android { ...@@ -32,9 +32,10 @@ android {
dependencies { dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"]) implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.google.android.material:material:1.2.0' implementation 'com.google.android.material:material:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.viewpager:viewpager:1.0.0'
def room_version = "2.2.5" def room_version = "2.2.5"
...@@ -55,5 +56,8 @@ dependencies { ...@@ -55,5 +56,8 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
<<<<<<< HEAD
=======
>>>>>>> dev-5
} }
\ No newline at end of file
...@@ -17,7 +17,10 @@ ...@@ -17,7 +17,10 @@
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme2"> android:theme="@style/AppTheme2">
<activity android:name=".activities.StatusPayment"></activity> <activity android:name=".activities.WelcomeActivity"></activity>
<activity android:name=".activities.ForgetPassword" />
<activity android:name=".activities.RegisterActivity" />
<activity android:name=".activities.StatusPayment" />
<activity <activity
android:name=".activities.SplashActivity" android:name=".activities.SplashActivity"
android:theme="@style/AppTheme2"> android:theme="@style/AppTheme2">
...@@ -33,11 +36,21 @@ ...@@ -33,11 +36,21 @@
<activity <activity
android:name=".activities.CartActivity" android:name=".activities.CartActivity"
android:theme="@style/AppTheme2" /> android:theme="@style/AppTheme2" />
<<<<<<< HEAD
<activity android:name=".activities.MainActivity" android:theme="@style/AppTheme2"/> <activity android:name=".activities.MainActivity" android:theme="@style/AppTheme2"/>
<activity android:name=".activities.ProductActivity" android:theme="@style/AppTheme2"> <activity android:name=".activities.ProductActivity" android:theme="@style/AppTheme2">
</activity> </activity>
<activity android:name=".activities.LoginActivity"/> <activity android:name=".activities.LoginActivity"/>
=======
<activity
android:name=".activities.MainActivity"
android:theme="@style/AppTheme2" />
<activity
android:name=".activities.ProductActivity"
android:theme="@style/AppTheme2" />
<activity android:name=".activities.LoginActivity" />
>>>>>>> dev-5
<provider <provider
android:name="androidx.core.content.FileProvider" android:name="androidx.core.content.FileProvider"
...@@ -46,8 +59,9 @@ ...@@ -46,8 +59,9 @@
android:grantUriPermissions="true"> android:grantUriPermissions="true">
<meta-data <meta-data
android:name="android.support.FILE_PROVIDER_PATHS" android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_path"/> android:resource="@xml/file_path" />
</provider> </provider>
<meta-data <meta-data
android:name="preloaded_fonts" android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts" /> android:resource="@array/preloaded_fonts" />
......
package com.example.yourcashiertest.activities;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.example.yourcashiertest.R;
public class ForgetPassword extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_forget_password);
}
}
\ No newline at end of file
...@@ -41,8 +41,13 @@ public class LoginActivity extends AppCompatActivity { ...@@ -41,8 +41,13 @@ public class LoginActivity extends AppCompatActivity {
} }
} }
}); });
}
public void tvForgetPassword(View view) {
startActivity(new Intent(LoginActivity.this, ForgetPassword.class));
}
public void tvSignUpHere(View view) {
startActivity(new Intent(LoginActivity.this, RegisterActivity.class));
} }
} }
\ No newline at end of file
package com.example.yourcashiertest.activities;
import android.content.Context;
import android.content.SharedPreferences;
public class PrefManager {
SharedPreferences pref;
SharedPreferences.Editor editor;
Context _context;
// shared pref mode
int PRIVATE_MODE = 0;
// Shared preferences file name
private static final String PREF_NAME = "introslider";
private static final String IS_FIRST_TIME_LAUNCH = "IsFirstTimeLaunch";
public PrefManager(Context context) {
this._context = context;
pref = _context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
editor = pref.edit();
}
public void setFirstTimeLaunch(boolean isFirstTime) {
editor.putBoolean(IS_FIRST_TIME_LAUNCH, isFirstTime);
editor.commit();
}
public boolean isFirstTimeLaunch() {
return pref.getBoolean(IS_FIRST_TIME_LAUNCH, true);
}
}
...@@ -4,6 +4,7 @@ import androidx.appcompat.app.AppCompatActivity; ...@@ -4,6 +4,7 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.FileProvider; import androidx.core.content.FileProvider;
import androidx.databinding.DataBindingUtil; import androidx.databinding.DataBindingUtil;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import androidx.loader.content.CursorLoader;
import android.Manifest; import android.Manifest;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
...@@ -44,7 +45,8 @@ public class ProductActivity extends AppCompatActivity{ ...@@ -44,7 +45,8 @@ public class ProductActivity extends AppCompatActivity{
private static final int REQUEST_IMAGE_CAPTURE = 1; private static final int REQUEST_IMAGE_CAPTURE = 1;
private File file; private File file;
private ProductViewModel viewModel; private ProductViewModel viewModel;
Uri imageUri; Uri selectedImageUri;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
...@@ -54,7 +56,6 @@ public class ProductActivity extends AppCompatActivity{ ...@@ -54,7 +56,6 @@ public class ProductActivity extends AppCompatActivity{
binding = DataBindingUtil.setContentView(this, R.layout.activity_product); binding = DataBindingUtil.setContentView(this, R.layout.activity_product);
Product product = getIntent().getParcelableExtra(MainActivity.DATA_PRODUCT); Product product = getIntent().getParcelableExtra(MainActivity.DATA_PRODUCT);
if (getSupportActionBar() != null) { if (getSupportActionBar() != null) {
getSupportActionBar().setHomeButtonEnabled(true); getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
...@@ -84,7 +85,8 @@ public class ProductActivity extends AppCompatActivity{ ...@@ -84,7 +85,8 @@ public class ProductActivity extends AppCompatActivity{
} }
if (file != null){ if (file != null){
fixProduct.setPhoto(file.getAbsolutePath()); // fixProduct.setPhoto(file.getAbsolutePath());
fixProduct.setPhoto(selectedImageUri.toString());
}else { }else {
fixProduct.setPhoto(""); fixProduct.setPhoto("");
} }
...@@ -110,6 +112,21 @@ public class ProductActivity extends AppCompatActivity{ ...@@ -110,6 +112,21 @@ public class ProductActivity extends AppCompatActivity{
binding.setViewModel(viewModel); binding.setViewModel(viewModel);
} }
private void openFile(){
Intent i = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(i, 100);
}
private String getRealPathFromURI(Uri contentUri) {
String[] proj = {MediaStore.Images.Media.DATA};
CursorLoader loader = new CursorLoader(this, contentUri, proj, null, null, null);
Cursor cursor = loader.loadInBackground();
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
String result = cursor.getString(column_index);
cursor.close();
return result;
}
private void takePhoto() { private void takePhoto() {
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
...@@ -173,10 +190,16 @@ public class ProductActivity extends AppCompatActivity{ ...@@ -173,10 +190,16 @@ public class ProductActivity extends AppCompatActivity{
} }
} }
public void getPhoto(){
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "select a picture"), REQUEST_IMAGE_CAPTURE);
}
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
// if (requestCode == PICK_IMAGE && resultCode == RESULT_OK) { // if (requestCode == PICK_IMAGE && resultCode == RESULT_OK) {
// imageUri = data.getData(); // imageUri = data.getData();
// String[] filePathColumn = { MediaStore.Images.Media.DATA }; // String[] filePathColumn = { MediaStore.Images.Media.DATA };
...@@ -184,7 +207,11 @@ public class ProductActivity extends AppCompatActivity{ ...@@ -184,7 +207,11 @@ public class ProductActivity extends AppCompatActivity{
// filePathColumn, null, null, null); // filePathColumn, null, null, null);
// cursor.moveToFirst(); // cursor.moveToFirst();
// cursor.close(); // cursor.close();
// } if (requestCode == REQUEST_IMAGE_CAPTURE) {
if(resultCode == RESULT_OK) {
selectedImageUri = data.getData();
}
}
} }
@Override @Override
......
package com.example.yourcashiertest.activities;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import com.example.yourcashiertest.R;
public class RegisterActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
}
public void tvSignInHere(View view) {
startActivity(new Intent(RegisterActivity.this, LoginActivity.class));
}
}
\ No newline at end of file
...@@ -14,7 +14,7 @@ public class SplashActivity extends AppCompatActivity { ...@@ -14,7 +14,7 @@ public class SplashActivity extends AppCompatActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash); setContentView(R.layout.activity_splash);
new Handler(Looper.getMainLooper()).postDelayed(() -> { new Handler(Looper.getMainLooper()).postDelayed(() -> {
startActivity(new Intent(this, LoginActivity.class)); startActivity(new Intent(this, WelcomeActivity.class));
finish(); finish();
}, 2000); }, 2000);
} }
......
package com.example.yourcashiertest.activities;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.example.yourcashiertest.R;
public class WelcomeActivity extends AppCompatActivity {
private ViewPager viewPager;
private MyViewPagerAdapter myViewPagerAdapter;
private LinearLayout dotsLayout;
private TextView[] dots;
private int[] layouts;
private Button btnSkip, btnNext;
private PrefManager prefManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// mengecek lauch activity - sebelum memanggil setContentView()
prefManager = new PrefManager(this);
if (!prefManager.isFirstTimeLaunch()) {
launchHomeScreen();
finish();
}
// membuat transparan notifikasi
if (Build.VERSION.SDK_INT >= 21) {
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
}
setContentView(R.layout.activity_welcome);
viewPager = (ViewPager) findViewById(R.id.view_pager);
dotsLayout = (LinearLayout) findViewById(R.id.layoutDots);
btnSkip = (Button) findViewById(R.id.btn_skip);
btnNext = (Button) findViewById(R.id.btn_next);
// layout xml slide 1 sampai 4
// add few more layouts if you want
layouts = new int[]{
R.layout.slide1,
R.layout.slide2,
R.layout.slide3};
// tombol dots (lingkaran kecil perpindahan slide)
addBottomDots(0);
// membuat transparan notifikasi
changeStatusBarColor();
myViewPagerAdapter = new MyViewPagerAdapter();
viewPager.setAdapter(myViewPagerAdapter);
viewPager.addOnPageChangeListener(viewPagerPageChangeListener);
btnSkip.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
launchHomeScreen();
}
});
btnNext.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// mengecek page terakhir (slide 4)
// jika activity home sudah tampil
int current = getItem(+1);
if (current < layouts.length) {
// move to next screen
viewPager.setCurrentItem(current);
} else {
launchHomeScreen();
}
}
});
}
private void addBottomDots(int currentPage) {
dots = new TextView[layouts.length];
int[] colorsActive = getResources().getIntArray(R.array.array_dot_active);
int[] colorsInactive = getResources().getIntArray(R.array.array_dot_inactive);
dotsLayout.removeAllViews();
for (int i = 0; i < dots.length; i++) {
dots[i] = new TextView(this);
dots[i].setText(Html.fromHtml("&#8226;"));
dots[i].setTextSize(35);
dots[i].setTextColor(colorsInactive[currentPage]);
dotsLayout.addView(dots[i]);
}
if (dots.length > 0)
dots[currentPage].setTextColor(colorsActive[currentPage]);
}
private int getItem(int i) {
return viewPager.getCurrentItem() + i;
}
private void launchHomeScreen() {
prefManager.setFirstTimeLaunch(false);
startActivity(new Intent(WelcomeActivity.this, LoginActivity.class));
finish();
}
// viewpager change listener
ViewPager.OnPageChangeListener viewPagerPageChangeListener = new ViewPager.OnPageChangeListener() {
@Override
public void onPageSelected(int position) {
addBottomDots(position);
// mengubah button lanjut 'NEXT' / 'GOT IT'
if (position == layouts.length - 1) {
// last page. make button text to GOT IT
btnNext.setText(getString(R.string.start));
btnSkip.setVisibility(View.GONE);
} else {
// still pages are left
btnNext.setText(getString(R.string.next));
btnSkip.setVisibility(View.VISIBLE);
}
}
@Override
public void onPageScrolled(int arg0, float arg1, int arg2) {
}
@Override
public void onPageScrollStateChanged(int arg0) {
}
};
/**
* Making notification bar transparent
*/
private void changeStatusBarColor() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.TRANSPARENT);
}
}
/**
* View pager adapter
*/
public class MyViewPagerAdapter extends PagerAdapter {
private LayoutInflater layoutInflater;
public MyViewPagerAdapter() {
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = layoutInflater.inflate(layouts[position], container, false);
container.addView(view);
return view;
}
@Override
public int getCount() {
return layouts.length;
}
@Override
public boolean isViewFromObject(View view, Object obj) {
return view == obj;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
View view = (View) object;
container.removeView(view);
}
}
}
\ No newline at end of file
package com.example.yourcashiertest.entities; package com.example.yourcashiertest.entities;
import android.net.Uri;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import android.text.TextUtils; import android.text.TextUtils;
...@@ -128,10 +129,11 @@ public class Product implements Parcelable { ...@@ -128,10 +129,11 @@ public class Product implements Parcelable {
public static void setImage(ImageView view, String path) { public static void setImage(ImageView view, String path) {
if (TextUtils.isEmpty(path)) view.setImageResource(R.drawable.unnamed); if (TextUtils.isEmpty(path)) view.setImageResource(R.drawable.unnamed);
else { else {
File file = new File(path); // File file = new File(path);
Uri uri = Uri.parse(path);
if (file.exists()) Glide.with(view).load(file).into(view); Glide.with(view).load(new File(uri.getPath())).into(view);
else view.setImageResource(R.drawable.unnamed); // if (file.exists()) Glide.with(view).load(file).into(view);
// else view.setImageResource(R.drawable.unnamed);
} }
} }
} }
<?xml version="1.0" encoding="utf-8"?>
<animated-selector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="NewApi">
<item
android:id="@+id/visible"
android:drawable="@drawable/design_ic_visibility_off"
android:state_checked="true"/>
<item
android:id="@+id/masked"
android:drawable="@drawable/design_ic_visibility"/>
<transition
android:drawable="@drawable/avd_hide_password"
android:fromId="@id/masked"
android:toId="@id/visible"/>
<transition
android:drawable="@drawable/avd_show_password"
android:fromId="@id/visible"
android:toId="@id/masked"/>
</animated-selector>
\ No newline at end of file
<?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"
android:paddingHorizontal="10dp"
tools:context=".activities.ForgetPassword">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilEmail"
app:boxBackgroundColor="@color/white"
android:textColorHint="@color/grey"
app:boxStrokeColor="@color/black"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
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/etEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Email"
android:inputType="textEmailAddress"
android:imeOptions="actionNext"
android:textSize="@dimen/text_default" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/btnResetPw"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginStart="@dimen/space_default"
android:layout_marginEnd="@dimen/space_default"
android:backgroundTint="@color/colorPrimary"
android:padding="@dimen/space_default"
android:text="RESET PASSWORD"
app:cornerRadius="@dimen/space_default"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tilEmail" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
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"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_margin="@dimen/space_default" android:padding="10dp"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".activities.LoginActivity"> tools:context=".activities.LoginActivity">
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
android:textStyle="bold" android:textStyle="bold"
android:text="Login"/> android:text="Login"/>
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilUsername" android:id="@+id/tilUsername"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
...@@ -35,8 +34,8 @@ ...@@ -35,8 +34,8 @@
android:id="@+id/etUsername" android:id="@+id/etUsername"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="Masukkan username..." android:hint="Masukkan Email"
android:inputType="textCapWords" android:inputType="textEmailAddress"
android:imeOptions="actionNext" android:imeOptions="actionNext"
android:textSize="@dimen/text_default" /> android:textSize="@dimen/text_default" />
...@@ -47,6 +46,7 @@ ...@@ -47,6 +46,7 @@
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:passwordToggleEnabled="true"
app:layout_constraintTop_toBottomOf="@+id/tilUsername" app:layout_constraintTop_toBottomOf="@+id/tilUsername"
android:layout_marginStart="@dimen/space_default" android:layout_marginStart="@dimen/space_default"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
...@@ -57,24 +57,58 @@ ...@@ -57,24 +57,58 @@
android:id="@+id/etPassword" android:id="@+id/etPassword"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="Masukkan password..." android:hint="Masukkan Password"
android:inputType="textPassword" android:inputType="textPassword"
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.textview.MaterialTextView
android:onClick="tvForgetPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="24dp"
android:text="@string/lupa_password"
android:textColor="@color/colorPrimary"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tilPassword" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:id="@+id/btnLogin" android:id="@+id/btnLogin"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Login"
android:backgroundTint="@color/colorPrimary"
app:layout_constraintTop_toBottomOf="@+id/tilPassword"
android:layout_marginTop="60dp" android:layout_marginTop="60dp"
app:layout_constraintEnd_toEndOf="parent" android:layout_marginStart="@dimen/space_default"
android:layout_marginEnd="@dimen/space_default"
android:backgroundTint="@color/colorPrimary"
android:padding="@dimen/space_default" android:padding="@dimen/space_default"
android:text="Login"
app:cornerRadius="@dimen/space_default" app:cornerRadius="@dimen/space_default"
android:layout_marginEnd="@dimen/space_default"/> app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tilPassword" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvDontHaveAnAccount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="60dp"
android:layout_marginTop="15dp"
android:text="@string/dont_have_an_account"
app:layout_constraintEnd_toStartOf="@id/tvSignUpHere"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnLogin" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvSignUpHere"
android:onClick="tvSignUpHere"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:layout_marginTop="15dp"
android:text="@string/sign_up_here"
android:textColor="@color/blue"
app:layout_constraintStart_toEndOf="@id/tvDontHaveAnAccount"
app:layout_constraintTop_toBottomOf="@id/btnLogin" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
tools:context=".activities.PaymentActivity"> tools:context=".activities.PaymentActivity">
<!-- Payment --> <!-- Payment -->
<com.google.android.material.textview.MaterialTextView <TextView
android:id="@+id/tvPayment" android:id="@+id/tvPayment"
android:layout_width="108dp" android:layout_width="108dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.105" /> app:layout_constraintVertical_bias="0.105" />
<com.google.android.material.textview.MaterialTextView <TextView
android:id="@+id/tvTotal" android:id="@+id/tvTotal"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>
<com.google.android.material.textview.MaterialTextView <TextView
android:id="@+id/tvAmountPaid" android:id="@+id/tvAmountPaid"
android:layout_width="100dp" android:layout_width="100dp"
android:layout_height="30dp" android:layout_height="30dp"
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<data> <data>
<variable
name="photo"
type="String" />
<variable <variable
name="viewModel" name="viewModel"
type="com.example.yourcashiertest.viewmodels.ProductViewModel" /> type="com.example.yourcashiertest.viewmodels.ProductViewModel" />
...@@ -15,7 +18,7 @@ ...@@ -15,7 +18,7 @@
android:background="@color/white" android:background="@color/white"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<com.google.android.material.textview.MaterialTextView <TextView
android:id="@+id/tvHeadProduct" android:id="@+id/tvHeadProduct"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -39,11 +42,11 @@ ...@@ -39,11 +42,11 @@
<ImageView <ImageView
android:id="@+id/ivProduct" android:id="@+id/ivProduct"
android:layout_width="match_parent" android:layout_width="146dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@drawable/unnamed" android:src="@drawable/unnamed"
app:file="@{viewModel.product.photo}"/> app:file="@{photo}" />
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>
......
<?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=".activities.RegisterActivity">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvRegister"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25dp"
android:layout_marginTop="80dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:textStyle="bold"
android:text="Register Account"/>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilUsername"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/tvRegister"
android:layout_marginTop="60dp"
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/etUsername"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Complete Name"
android:inputType="textCapWords"
android:imeOptions="actionNext"
android:textSize="@dimen/text_default" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilEmail"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/tilUsername"
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/etEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Email"
android:inputType="textEmailAddress"
android:imeOptions="actionNext"
android:textSize="@dimen/text_default" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilPhoneNumber"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/tilEmail"
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/etPhoneNumber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Phone Number"
android:inputType="phone"
android:imeOptions="actionNext"
android:textSize="@dimen/text_default" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilPassword"
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/tilPhoneNumber"
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/etPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:inputType="textPassword"
android:imeOptions="actionNext"
android:textSize="@dimen/text_default" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/btnRegister"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginStart="@dimen/space_default"
android:layout_marginEnd="@dimen/space_default"
android:backgroundTint="@color/colorPrimary"
android:padding="@dimen/space_default"
android:text="Register My Account"
app:cornerRadius="@dimen/space_default"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tilPassword" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvDontHaveAnAccount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="60dp"
android:layout_marginTop="15dp"
android:text="@string/dont_have_an_account"
app:layout_constraintEnd_toStartOf="@id/tvSignInHere"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnRegister" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvSignInHere"
android:onClick="tvSignInHere"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:layout_marginTop="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>
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
android:padding="10dp" android:padding="10dp"
tools:context=".activities.StatusPayment"> tools:context=".activities.StatusPayment">
<com.google.android.material.textview.MaterialTextView <TextView
android:id="@+id/tvPaymentStatus" android:id="@+id/tvPaymentStatus"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.imageview.ShapeableImageView <ImageView
android:id="@+id/icConfirmed" android:id="@+id/icConfirmed"
android:layout_width="150dp" android:layout_width="150dp"
android:layout_height="130dp" android:layout_height="130dp"
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
tools:layout_editor_absoluteX="140dp" tools:layout_editor_absoluteX="140dp"
tools:layout_editor_absoluteY="29dp" /> tools:layout_editor_absoluteY="29dp" />
<com.google.android.material.textview.MaterialTextView <TextView
android:id="@+id/tvPaymentSuccess" android:id="@+id/tvPaymentSuccess"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/icConfirmed" /> app:layout_constraintTop_toBottomOf="@id/icConfirmed" />
<com.google.android.material.textview.MaterialTextView <TextView
android:id="@+id/tvRefund" android:id="@+id/tvRefund"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPaymentSuccess" /> app:layout_constraintTop_toBottomOf="@id/tvPaymentSuccess" />
<com.google.android.material.textview.MaterialTextView <TextView
android:id="@+id/tvNominalRefund" android:id="@+id/tvNominalRefund"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:showIn="@layout/activity_welcome">
<androidx.viewpager.widget.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:id="@+id/layoutDots"
android:layout_width="match_parent"
android:layout_height="@dimen/dots_height"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/dots_margin_bottom"
android:gravity="center"
android:orientation="horizontal"/>
<View
android:layout_width="match_parent"
android:paddingHorizontal="10dp"
android:layout_height="1dp"
android:alpha=".5"
android:layout_above="@id/layoutDots"
android:background="@android:color/white" />
<Button
android:id="@+id/btn_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:background="@android:color/transparent"
android:text="@string/next"
android:textStyle="bold"
android:textColor="@color/colorPrimary" />
<Button
android:id="@+id/btn_skip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@android:color/transparent"
android:text="@string/skip"
android:textStyle="bold"
android:textColor="@color/colorPrimary" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="250dp"
android:layout_height="200dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/slide_1_title"
android:textColor="@android:color/black"
android:textSize="@dimen/slide_title"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:paddingLeft="@dimen/desc_padding"
android:paddingRight="@dimen/desc_padding"
android:text="@string/slide_1_desc"
android:textAlignment="center"
android:textColor="@android:color/black"
android:textSize="@dimen/slide_desc" />
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="250dp"
android:layout_height="200dp"
android:src="@drawable/organize"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/slide_2_title"
android:textColor="@android:color/black"
android:textSize="@dimen/slide_title"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:paddingLeft="@dimen/desc_padding"
android:paddingRight="@dimen/desc_padding"
android:text="@string/slide_2_desc"
android:textAlignment="center"
android:textColor="@android:color/black"
android:textSize="@dimen/slide_desc" />
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="250dp"
android:layout_height="200dp"
android:src="@drawable/mobile_payment"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/slide_3_title"
android:textColor="@android:color/black"
android:textSize="@dimen/slide_title"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:paddingLeft="@dimen/desc_padding"
android:paddingRight="@dimen/desc_padding"
android:text="@string/slide_3_desc"
android:textAlignment="center"
android:textColor="@android:color/black"
android:textSize="@dimen/slide_desc" />
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
...@@ -11,4 +11,31 @@ ...@@ -11,4 +11,31 @@
<color name="colorDanger">#cf1b1b</color> <color name="colorDanger">#cf1b1b</color>
<color name="color_white">#fff</color> <color name="color_white">#fff</color>
<color name="color_grey">#fff</color> <color name="color_grey">#fff</color>
<color name="blue">#2196F3</color>
<!-- dots inactive colors -->
<color name="dot_dark_screen1">#FFFFF0</color>
<color name="dot_dark_screen2">#FFFFF0</color>
<color name="dot_dark_screen3">#FFFFF0</color>
<color name="dot_dark_screen4">#FFFFF0</color>
<!-- dots active colors -->
<color name="dot_light_screen1">#A9A9A9</color>
<color name="dot_light_screen2">#A9A9A9</color>
<color name="dot_light_screen3">#A9A9A9</color>
<color name="dot_light_screen4">#A9A9A9</color>
<array name="array_dot_active">
<item>@color/dot_light_screen1</item>
<item>@color/dot_light_screen2</item>
<item>@color/dot_light_screen3</item>
<item>@color/dot_light_screen4</item>
</array>
<array name="array_dot_inactive">
<item>@color/dot_dark_screen1</item>
<item>@color/dot_dark_screen2</item>
<item>@color/dot_dark_screen3</item>
<item>@color/dot_dark_screen4</item>
</array>
</resources> </resources>
\ No newline at end of file
...@@ -5,4 +5,13 @@ ...@@ -5,4 +5,13 @@
<dimen name="text_large">20sp</dimen> <dimen name="text_large">20sp</dimen>
<dimen name="space_small">8dp</dimen> <dimen name="space_small">8dp</dimen>
<dimen name="text_small">12sp</dimen> <dimen name="text_small">12sp</dimen>
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="dots_height">30dp</dimen>
<dimen name="dots_margin_bottom">20dp</dimen>
<dimen name="slide_title">30dp</dimen>
<dimen name="slide_desc">16dp</dimen>
<dimen name="desc_padding">40dp</dimen>
</resources> </resources>
\ No newline at end of file
...@@ -27,4 +27,22 @@ ...@@ -27,4 +27,22 @@
<string name="payment_by_cash_was_successful">Payment by Cash was successful</string> <string name="payment_by_cash_was_successful">Payment by Cash was successful</string>
<string name="refund">Refund</string> <string name="refund">Refund</string>
<string name="payment_status">Payment Status</string> <string name="payment_status">Payment Status</string>
<string name="lupa_password">Forget Password?</string>
<string name="dont_have_an_account">Dont have an Account?</string>
<string name="sign_up_here">Sign Up Here</string>
<string name="sign_in_here">Sign In Here</string>
<string name="title_activity_welcome">Home Screen</string>
<string name="next">LANJUT</string>
<string name="skip">LEWATI</string>
<string name="start">MULAI</string>
<string name="slide_1_title">SMART SOFTWARE</string>
<string name="slide_1_desc">Manage your business easily and practically</string>
<string name="slide_2_title">FLEXIBILITY</string>
<string name="slide_2_desc">Easily manage your transaction, payment, and stock anywhere</string>
<string name="slide_3_title">FUTURE PAYMENT</string>
<string name="slide_3_desc">Integrated with easy and secure payments</string>
</resources> </resources>
\ No newline at end of file
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">#333</item> <item name="colorAccent">#333</item>
</style> </style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="burger_medi"> <style name="burger_medi">
<item name="android:textSize"> <item name="android:textSize">
......
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