Commit 6ac0ec6a authored by Trio Saputra's avatar Trio Saputra

layout add

parent 5f20f78c
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
......@@ -23,6 +23,12 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
......
......@@ -8,14 +8,15 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
android:theme="@style/AppTheme.NoActionBar">
<activity android:name=".ProductActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity">
</activity>
</application>
</manifest>
\ No newline at end of file
package com.example.yourcashiertest;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class ProductActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_product);
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout 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">
<data>
<variable
name="photo"
type="String" />
</data>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorBackground"
tools:context=".activities.ProductActivity">
<com.google.android.material.card.MaterialCardView
android:id="@+id/cvProduct"
android:layout_width="160dp"
android:layout_height="160dp"
android:layout_centerHorizontal="true"
android:layout_margin="16dp"
app:cardCornerRadius="80dp">
<ImageView
android:id="@+id/ivProduct"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/unnamed"/>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilProduct"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/cvProduct"
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/etProduct"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Nama produk"
android:inputType="textCapWords"
android:textSize="@dimen/text_default" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilPrice"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tilProduct"
android:layout_marginStart="@dimen/space_default"
android:layout_marginBottom="@dimen/space_default"
android:layout_toStartOf="@id/tilQuantity">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/etPrice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Harga"
android:inputType="number"
android:textSize="@dimen/text_default" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilQuantity"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="96dp"
android:layout_height="wrap_content"
android:layout_below="@id/tilProduct"
android:layout_alignParentEnd="true"
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/etQuantity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Jumlah"
android:inputType="number"
android:textSize="@dimen/text_default" />
</com.google.android.material.textfield.TextInputLayout>
<Spinner
android:id="@+id/spCategory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:listitem="@layout/support_simple_spinner_dropdown_item"
android:layout_below="@+id/tilPrice"
android:layout_marginStart="@dimen/space_default"
android:layout_marginBottom="@dimen/space_default"
android:layout_marginEnd="@dimen/space_default"
tools:ignore="NotSibling" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/tilDescription"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/spCategory"
android:layout_marginStart="@dimen/space_default"
android:layout_marginEnd="@dimen/space_default">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/etDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start|top"
android:hint="Deskripsi produk"
android:inputType="textMultiLine"
android:lines="3"
android:maxLines="3"
android:text=""
android:textSize="@dimen/text_default" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/btnSubmit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tilDescription"
android:layout_margin="@dimen/space_default"
android:backgroundTint="@color/colorPrimary"
android:padding="16dp"
android:text="Tambah Produk"
android:textColor="@color/white"
app:cornerRadius="@dimen/space_default"
android:elevation="5dp" />
</RelativeLayout>
</layout>
\ No newline at end of file
......@@ -27,16 +27,14 @@
android:id="@+id/ivUpdate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/space_small"
android:src="@drawable/ic_update"/>
android:padding="@dimen/space_small" />
<ImageView
android:id="@+id/ivDelete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/space_small"
android:layout_alignParentEnd="true"
android:src="@drawable/ic_delete"/>
android:layout_alignParentEnd="true"/>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tvQuantity"
......@@ -46,7 +44,6 @@
android:layout_alignParentEnd="true"
android:layout_marginEnd="1dp"
android:layout_marginBottom="0dp"
android:background="@drawable/bg_quantity"
android:fontFamily="monospace"
android:padding="@dimen/space_small"
android:text="@{product.quantity + ``}"
......@@ -60,7 +57,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ivProduct"
android:fontFamily="@font/roboto_medium"
android:fontFamily=""
android:gravity="center"
android:padding="@dimen/space_small"
android:text="@{product.name}"
......@@ -75,7 +72,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tvProduct"
android:fontFamily="@font/roboto_medium"
android:fontFamily=""
android:gravity="end"
android:paddingStart="@dimen/space_small"
android:paddingEnd="@dimen/space_small"
......@@ -89,7 +86,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tvPrice"
android:fontFamily="@font/roboto_medium"
android:fontFamily=""
android:padding="@dimen/space_small"
android:text="@{product.description}"
android:textColor="@android:color/darker_gray"
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="text_default">16sp</dimen>
<dimen name="space_default">16dp</dimen>
<dimen name="space_default">10dp</dimen>
<dimen name="text_large">20sp</dimen>
<dimen name="space_small">8dp</dimen>
<dimen name="text_small">12sp</dimen>
......
<resources>
<string name="app_name">Your Cashier</string>
<string-array name="category">
<item>Makanan</item>
<item>Minuman</item>
<item>Lainnya</item>
</string-array>
</resources>
\ No newline at end of file
......@@ -7,4 +7,11 @@
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
\ No newline at end of file
......@@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.0"
classpath 'com.android.tools.build:gradle:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
......
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