Commit 42443fbb by Andreas Tampubolon

Initial commit

parents
*.iml
.gradle
/local.properties
/.idea/caches/build_file_checksums.ser
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
.DS_Store
/build
/captures
.externalNativeBuild
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<Objective-C-extensions>
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
</file>
<class>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
</class>
<extensions>
<pair source="cpp" header="h" fileNamingConvention="NONE" />
<pair source="c" header="h" fileNamingConvention="NONE" />
</extensions>
</Objective-C-extensions>
</code_scheme>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="7">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
<item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="6">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8 (2)" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
\ No newline at end of file
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "andreas.develops.proyek.kelompok"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.github.bumptech.glide:glide:4.3.1'
}
apply plugin: 'com.google.gms.google-services'
{
"project_info": {
"project_number": "248916786234",
"firebase_url": "https://kelompok-7e912.firebaseio.com",
"project_id": "kelompok-7e912",
"storage_bucket": "kelompok-7e912.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:248916786234:android:f57232a20123370d",
"android_client_info": {
"package_name": "andreas.develops.proyek.kelompok"
}
},
"oauth_client": [
{
"client_id": "248916786234-k944n91craoa2h6datfh9kr2mhq2ot16.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBmSgihBWl1V22w3fJ7ltaTu9vt82yAP0A"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "248916786234-k944n91craoa2h6datfh9kr2mhq2ot16.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
package andreas.develops.proyek.kelompok;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("andreas.develops.proyek.kelompok", appContext.getPackageName());
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="andreas.develops.proyek.kelompok">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".Login">
</activity>
<activity android:name=".Registrasi" />
<activity android:name=".MainActivity" />
<activity android:name=".ProdukList" />
<activity android:name=".ProdukListCustomer" />
<activity android:name=".ProdukDetail" />
<activity android:name=".PemesananList"></activity>
<activity android:name=".listview1" />
<activity android:name=".firebase" />
<activity android:name=".Broadcast" />
<activity android:name=".About"></activity>
<activity android:name=".ContentProvider" />
<activity android:name=".Splashscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
package andreas.develops.proyek.kelompok;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.Toast;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
public class About extends AppCompatActivity {
public ListView listView;
private List<PlayerItem> playerItemList;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
playerItemList = new ArrayList<>();
loadPlayer();
listView = findViewById(R.id.listView);
}
private void loadPlayer() {
StringRequest stringRequest = new StringRequest(Request.Method.GET, JSON_URL,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
JSONObject obj = new JSONObject(response);
JSONArray playerArray = obj.getJSONArray("result");
for (int i = 0; i < playerArray.length(); i++) {
JSONObject playerObject = playerArray.getJSONObject(i);
PlayerItem playerItem = new PlayerItem(
playerObject.getString("no"),
playerObject.getString("name"),
playerObject.getString("Position"),
playerObject.getString("Poster"));
playerItemList.add(playerItem);
}
ListViewAdapter adapter = new ListViewAdapter(playerItemList, getApplicationContext());
listView.setAdapter(adapter);
} catch (JSONException e) {
e.printStackTrace();
}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(getApplicationContext(), error.getMessage(), Toast.LENGTH_SHORT).show();
}
});
RequestQueue requestQueue = Volley.newRequestQueue(this);
requestQueue.add(stringRequest);
}
private static final String JSON_URL = "https://raw.githubusercontent.com/andreas1009/produk1/master/produk.json";
}
package andreas.develops.proyek.kelompok;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
public class Broadcast extends AppCompatActivity {
private TextView batteryLevel;
private ProgressBar mBatteryLevelProgress;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_broadcast);
batteryLevel = (TextView) findViewById(R.id.batteryLevel);
mBatteryLevelProgress = (ProgressBar) findViewById(R.id.progressBar);
//Kode untuk meregister event yang akan ditangkap oleh BroadcastReceiver
//Bisa juga diset di AndroidManifest.xml file
this.registerReceiver(this.myBatteryReceiver, new
IntentFilter(Intent.ACTION_BATTERY_CHANGED));
}
private BroadcastReceiver myBatteryReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
int lvl = intent.getIntExtra("level", 0);
batteryLevel.setText("Battery anda saat ini : " +
String.valueOf(lvl) + "%");
mBatteryLevelProgress.setProgress(lvl);
if (lvl == 100) {
Toast.makeText(context, "Battery Full.",
Toast.LENGTH_LONG).show();
}
}
};
}
package andreas.develops.proyek.kelompok;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.database.Cursor;
import android.net.Uri;
import android.provider.ContactsContract;
import android.util.Log;
import android.widget.TextView;
public class ContentProvider extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_content_provider);
TextView contact = (TextView) findViewById(R.id.contact);
Cursor cursor = getContacts();
while (cursor.moveToNext()) {
/*Get contact information*/
String contactID =
cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID));
String displayName =
cursor.getString(cursor.getColumnIndex(ContactsContract.Data.DISPLAY_NAME));
String displayPhone = "";
int hasPhone =
cursor.getInt(cursor.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER))
;
/*Check if phone number exist*/
if (hasPhone == 1) {
Cursor phoneCursor =
getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
null,
ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = " + contactID, null, null);
while (phoneCursor.moveToNext()) {
Log.v("Content Providers", displayPhone =
phoneCursor.getString(phoneCursor.getColumnIndex(
ContactsContract.CommonDataKinds.Phone.NUMBER)));
}
phoneCursor.close();
}
/*Display contact information*/
contact.append(displayName + "\n" + displayPhone);
contact.append("\n======================\n");
}
}
private Cursor getContacts() {
/* Run query */
Uri uri = ContactsContract.Contacts.CONTENT_URI;
String[] projection = new String[]{ContactsContract.Contacts._ID,
ContactsContract.Contacts.DISPLAY_NAME,
ContactsContract.Contacts.HAS_PHONE_NUMBER};
String selection = ContactsContract.Contacts.IN_VISIBLE_GROUP + " = '" +
("1") + "'";
String[] selectionArgs = null;
String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + " COLLATE LOCALIZED ASC";
return managedQuery(uri, projection, selection, selectionArgs,
sortOrder);
}
}
package andreas.develops.proyek.kelompok;
import android.content.ClipData;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import android.content.ClipData.Item;
import java.util.ArrayList;
public class CustomAdapter extends BaseAdapter {
private Context context;
private int layout;
private ArrayList<ModelPemesanan> foodsList;
LayoutInflater inflter;
public CustomAdapter(Context context, int layout, ArrayList<ModelPemesanan> foodsList) {
this.context = context;
this.layout = layout;
this.foodsList = foodsList;
}
@Override
public int getCount() {
return foodsList.size();
}
@Override
public Object getItem(int i) {
return null;
}
@Override
public long getItemId(int i) {
return 0;
}
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
ModelPemesanan modelPemesanan = (ModelPemesanan) getItem(i);
if(view == null){
view = LayoutInflater.from(context).inflate(R.layout.activity_listview1,viewGroup,false);
}
ModelPemesanan currenItem = (ModelPemesanan) getItem(i);
TextView tx1 = (TextView)view.findViewById(R.id.textView);
tx1.setText("beras");
return view;
//
// view = inflter.inflate(R.layout.activity_listview1, null);
// TextView country = (TextView) view.findViewById(R.id.textView);
// TextView beli = (TextView) view.findViewById(R.id.beli);
// ImageView icon = (ImageView) view.findViewById(R.id.icon);
//
// ModelPemesanan md = foodsList.get(i);
//
// country.setText(md.getProduk());
// return view;
}
}
package andreas.develops.proyek.kelompok;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import java.util.ArrayList;
public class DatabaseHandler extends SQLiteOpenHelper {
public static final String TABLE_NAME = "data_motor";
public static final String COLUMN_ID = "id";
public static final String COLUMN_MEREK = "merek_motor";
public static final String COLUMN_HARGA = "harga_motor";
public static final String COLUMN_GAMBAR = "gambar_motor";
public static final String COLUMN_STATUS = "status";
private static final String DATABASE_NAME ="booking";
private static final int DATABASE_VERSION=1;
// private static int gambarnya = R.drawable.motor;
private static final String db_motor = "create table "
+ TABLE_NAME + "("
+ COLUMN_ID +" integer primary key autoincrement, "
+ COLUMN_MEREK+ " varchar(50) not null, "
+ COLUMN_HARGA+ " varchar(50) not null, "
+ COLUMN_STATUS+ " varchar(50) not null, "
+ COLUMN_GAMBAR+ " int not null);";
private static final String db_user = "create table "
+ "user" + "("
+ COLUMN_ID +" integer primary key autoincrement, "
+ "nama_user"+ " varchar(50) not null, "
+ "role"+ " int not null, "
+ "username_user"+ " varchar(50) not null, "
+ "password_user"+ " varchar(50) not null);";
private static final String db_pemesanan = "create table "
+ "data_pemesanan" + "("
+ COLUMN_ID +" integer primary key autoincrement, "
+ "id_pemesan"+ " long not null, "
+ "id_produk"+ " integer not null, "
+ "id_petani"+ " long not null,"
+ "produk"+ " varchar(50) not null, "
+ "gambar"+ " BLOB not null, "
+ "total"+ " integer not null, "
+ "tanggal"+ " varchar(50) not null);";
// private static final String insert = "INSERT INTO data_motor(merek_motor, harga_motor, status, gambar_motor)values('Vario','Rp. 450.000','Tersedia',"+gambarnya+")";
private static final String insertu = "INSERT INTO user(nama_user,role, username_user, password_user)values('Julio',1,'JuBel','JuBel')";
private static final String insertu2 = "INSERT INTO user(nama_user,role, username_user, password_user)values('Julio2',2,'JuBel2','JuBel')";
private static final String insertu3 = "INSERT INTO user(nama_user,role, username_user, password_user)values('Julio3',2,'JuBel3','JuBel')";
public DatabaseHandler(Context context){
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(db_motor);
db.execSQL(db_user);
db.execSQL(db_pemesanan);
//db.execSQL(insert);
db.execSQL(insertu);
db.execSQL(insertu2);
db.execSQL(insertu3);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS "+TABLE_NAME);
onCreate(db);
}
// public void addRecordMotor(ModelMotor um){
// SQLiteDatabase db = getWritableDatabase();
//
// ContentValues values = new ContentValues();
// values.put(COLUMN_MEREK, um.getMerek_motor());
// values.put(COLUMN_HARGA, um.getHarga_motor());
// values.put(COLUMN_STATUS, um.getStatus());
// values.put(COLUMN_GAMBAR, um.getGambar());
//
//
// db.insert(TABLE_NAME,null, values);
// db.close();
// }
public void addUser(ModelUser um){
SQLiteDatabase db = getWritableDatabase();
ContentValues values = new ContentValues();
values.put("nama_user", um.getNama_user());
values.put("role", um.getRole());
values.put("username_user", um.getUsername());
values.put("password_user", um.getPassword());
db.insert("user",null, values);
db.close();
}
public void addPemesanan(ModelPemesanan pe){
SQLiteDatabase db = getWritableDatabase();
ContentValues values = new ContentValues();
values.put("id_pemesan",pe.getId_pemesan());
values.put("id_produk",pe.getId_produk());
values.put("id_petani",pe.getId_petani());
values.put("total",pe.getTotal());
values.put("produk",pe.getProduk());
values.put("tanggal",pe.getTanggal());
values.put("gambar1",pe.getGambar1());
db.insert("data_pemesanan",null, values);
db.close();
}
// public void addRecordBooking(ModelDataBooking um){
// SQLiteDatabase db = getWritableDatabase();
//
// ContentValues values = new ContentValues();
// values.put("id_user", um.getId_user());
// values.put("id_motor", um.getId_motor());
// values.put("nama_pembooking", um.getNama_pembooking());
// values.put("merek_motor", um.getMerek_motor());
// values.put("harga_motor", um.getHarga_motor());
// values.put("gambar", um.getGambar());
// values.put("tanggal_mulai", um.getTanggal_mulai());
// values.put("status", um.getStatus());
//
// db.insert("data_booking",null, values);
// db.close();
// System.out.println("Berhasil Ditambahkan");
// }
//
// public ArrayList<ModelMotor> getAllRecordMotorUser(){
// ArrayList<ModelMotor> motorList = new ArrayList<ModelMotor>();
//
// String sql = "SELECT * FROM data_motor WHERE status like 'Tersedia'";
//
// SQLiteDatabase db = this.getReadableDatabase();
// Cursor cursor = db.rawQuery(sql,null);
//
// if(cursor.moveToFirst()){
// do{
// ModelMotor userModels = new ModelMotor();
// userModels.setId(Integer.parseInt(cursor.getString(0)));
// userModels.setMerek_motor(cursor.getString(1));
// userModels.setHarga_motor(cursor.getString(2));
// userModels.setStatus(cursor.getString(3));
// userModels.setGambar(cursor.getInt(4));
// motorList.add(userModels);
// }while(cursor.moveToNext());
// }
//
// cursor.close();
//
// return motorList;
// }
// public ArrayList<ModelDataBooking> getAllRecordBooking(long id){
// ArrayList<ModelDataBooking> motorList = new ArrayList<ModelDataBooking>();
//
// String sql = "SELECT * FROM data_booking WHERE id_user ="+id;
//
// SQLiteDatabase db = this.getReadableDatabase();
// Cursor cursor = db.rawQuery(sql,null);
//
// if(cursor.moveToFirst()){
// do{
// ModelDataBooking bookingModels = new ModelDataBooking();
// bookingModels.setId(Integer.parseInt(cursor.getString(0)));
// bookingModels.setId_user(Integer.parseInt(cursor.getString(1)));
// bookingModels.setId_motor(Integer.parseInt(cursor.getString(2)));
// bookingModels.setNama_pembooking(cursor.getString(3));
// bookingModels.setMerek_motor(cursor.getString(4));
// bookingModels.setHarga_motor(cursor.getString(5));
// bookingModels.setGambar(Integer.parseInt(cursor.getString(6)));
// bookingModels.setTanggal_mulai(cursor.getString(7));
// bookingModels.setStatus(cursor.getString(8));;
// motorList.add(bookingModels);
// }while(cursor.moveToNext());
// }
//
// cursor.close();
//
// return motorList;
// }
//
// public ArrayList<ModelDataBooking> getAllRecordBooking(String status){
// ArrayList<ModelDataBooking> motorList = new ArrayList<ModelDataBooking>();
//
// String sql = "SELECT * FROM data_booking WHERE status like '"+status+"'";
//
// SQLiteDatabase db = this.getReadableDatabase();
// Cursor cursor = db.rawQuery(sql,null);
//
// if(cursor.moveToFirst()){
// do{
// ModelDataBooking bookingModels = new ModelDataBooking();
// bookingModels.setId(Integer.parseInt(cursor.getString(0)));
// bookingModels.setId_user(Integer.parseInt(cursor.getString(1)));
// bookingModels.setId_motor(Integer.parseInt(cursor.getString(2)));
// bookingModels.setNama_pembooking(cursor.getString(3));
// bookingModels.setMerek_motor(cursor.getString(4));
// bookingModels.setHarga_motor(cursor.getString(5));
// bookingModels.setGambar(Integer.parseInt(cursor.getString(6)));
// bookingModels.setTanggal_mulai(cursor.getString(7));
// bookingModels.setStatus(cursor.getString(8));;
// motorList.add(bookingModels);
// }while(cursor.moveToNext());
// }
//
// cursor.close();
//
// return motorList;
// }
//
// public ArrayList<ModelMotor> getAllRecordMotor(){
// ArrayList<ModelMotor> motorList = new ArrayList<ModelMotor>();
//
// String sql = "SELECT * FROM data_motor";
//
// SQLiteDatabase db = this.getReadableDatabase();
// Cursor cursor = db.rawQuery(sql,null);
//
// if(cursor.moveToFirst()){
// do{
// ModelMotor userModels = new ModelMotor();
// userModels.setId(Integer.parseInt(cursor.getString(0)));
// userModels.setMerek_motor(cursor.getString(1));
// userModels.setHarga_motor(cursor.getString(2));
// userModels.setStatus(cursor.getString(3));
// userModels.setGambar(cursor.getInt(4));
// motorList.add(userModels);
// }while(cursor.moveToNext());
// }
//
// cursor.close();
//
// return motorList;
// }
public ArrayList<ModelUser> getAllRecordUser(){
ArrayList<ModelUser> as = new ArrayList<ModelUser>();
String sql = "SELECT * FROM user";
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.rawQuery(sql,null);
if(cursor.moveToFirst()){
do{
ModelUser userModels = new ModelUser();
userModels.setId(Integer.parseInt(cursor.getString(0)));
userModels.setNama_user(cursor.getString(1));
userModels.setRole(cursor.getInt(2));
userModels.setUsername(cursor.getString(3));
userModels.setPassword(cursor.getString(4));
as.add(userModels);
}while(cursor.moveToNext());
}
cursor.close();
return as;
}
public Cursor viewData(){
SQLiteDatabase db = this.getReadableDatabase();
String query = "select * from pemesanan";
Cursor cursor = db.rawQuery(query,null);
return cursor;
}
// public static ModelMotor dataM(Integer id){
// String sql = "SELECT * FROM data_motor WHERE id = "+id;
// SQLiteDatabase db = DatabaseHandler.getReadableDatabase();
// Cursor cursor = db.rawQuery(sql, null);
//
// ModelMotor userModels = new ModelMotor();
// userModels.setId(Integer.parseInt(cursor.getString(0)));
// userModels.setMerek_motor(cursor.getString(1));
// userModels.setHarga_motor(cursor.getString(2));
// userModels.setStatus(cursor.getString(3));
// userModels.setGambar(cursor.getInt(4));
//
// return userModels;
// }
// public static String getMotorModelCount(long id, Context a){
// DatabaseHandler as = new DatabaseHandler(a);
// String sql = "SELECT * FROM data_booking where id = id";
// SQLiteDatabase db = as.getWritableDatabase();
// Cursor cursor = db.rawQuery(sql, null);
// String abc = cursor.getString(6);
// cursor.close();
// return abc;
// }
// public static void batalkan(long id, long id_motor, Context a){
// DatabaseHandler as = new DatabaseHandler(a);
// String sql = "UPDATE data_booking SET status = 'Dibatalkan' where id = "+id;
// SQLiteDatabase db = as.getWritableDatabase();
// Cursor cursor = db.rawQuery(sql, null);
// cursor.close();
// buat_sedia(id_motor, a);
//
// }
//
// public static void kembalikan(long id, long id_motor, Context a){
// DatabaseHandler as = new DatabaseHandler(a);
// String sql = "UPDATE data_booking SET status = 'Selesai' where id = "+id;
// SQLiteDatabase db = as.getWritableDatabase();
// Cursor cursor = db.rawQuery(sql, null);
// cursor.close();
// buat_sedia(id_motor, a);
// }
// public static void buat_sedia(long id, Context a){
// DatabaseHandler as = new DatabaseHandler(a);
// String sql = "UPDATE data_motor SET status = 'Tersedia' where id = "+id;
// SQLiteDatabase db = as.getWritableDatabase();
// Cursor cursor = db.rawQuery(sql, null);
// cursor.close();
// }
}
package andreas.develops.proyek.kelompok;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import java.util.List;
public class ListViewAdapter extends ArrayAdapter<PlayerItem> {
private List<PlayerItem> playerItemList;
private Context context;
public ListViewAdapter(List<PlayerItem> playerItemList, Context context) {
super(context, R.layout.list_item, playerItemList);
this.playerItemList = playerItemList;
this.context = context;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = LayoutInflater.from(context);
View listViewItem = inflater.inflate(R.layout.list_item, null, true);
TextView textViewNo = listViewItem.findViewById(R.id.textViewNo);
TextView textViewName = listViewItem.findViewById(R.id.textViewName);
TextView textViewPosition = listViewItem.findViewById(R.id.textViewPosition);
ImageView imgVIew = listViewItem.findViewById(R.id.Poster);
PlayerItem playerItem = playerItemList.get(position);
textViewNo.setText(playerItem.getNo());
textViewName.setText(playerItem.getName());
textViewPosition.setText(playerItem.getPosition());
Glide.with(context).load(playerItem.getPoster()).into(imgVIew);
return listViewItem;
}
}
\ No newline at end of file
package andreas.develops.proyek.kelompok;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import java.util.ArrayList;
public class Login extends AppCompatActivity {
DatabaseHandler a;
Login as;
EditText pass, uss;
public static long idLogin = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
as = this;
a = new DatabaseHandler(as);
pass = (EditText) findViewById(R.id.pass);
uss = (EditText) findViewById(R.id.uss);
}
public void login(View view) {
ArrayList<ModelUser> ab = new ArrayList<>();
ab = a.getAllRecordUser();
System.out.println(ab.size());
for(int i = 0; i < ab.size(); i++){
if(uss.getText().toString().equals(ab.get(i).getUsername())&&pass.getText().toString().equals(ab.get(i).getPassword())){
if(ab.get(i).getRole() == 1){
idLogin = ab.get(i).getId();
Toast.makeText(Login.this,String.valueOf(idLogin),Toast.LENGTH_LONG).show();
Intent intent = new Intent(Login.this, MainActivity.class);
startActivity(intent);
}else if(ab.get(i).getRole() == 2){
idLogin = ab.get(i).getId();
Intent intent = new Intent(Login.this, ProdukListCustomer.class);
intent.putExtra("id_user", ab.get(i).getId());
intent.putExtra("role", ab.get(i).getRole());
intent.putExtra("nama_pembooking", ab.get(i).getNama_user());
startActivity(intent);
}
break;
}else{
// Toast.makeText(getApplicationContext(),"Anda siapa",Toast.LENGTH_SHORT).show();
}
}
String sql = "SELECT * FROM user";
SQLiteDatabase db = a.getReadableDatabase();
Cursor cursor = db.rawQuery(sql,null);
cursor.moveToFirst();
while(cursor.moveToNext()){
}
cursor.close();
}
public void logins(View view) {
}
public void daftar(View view) {
Intent i = new Intent(Login.this, Registrasi.class);
startActivity(i);
}
}
package andreas.develops.proyek.kelompok;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
public class MainActivity extends AppCompatActivity {
EditText edtName, edtPrice;
Button btnChoose, btnAdd, btnList;
ImageView imageView;
final int REQUEST_CODE_GALLERY = 999;
public static SQLiteHelper sqLiteHelper;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
init();
sqLiteHelper = new SQLiteHelper(this, "ProdukDB1.sqlite", null, 1);
sqLiteHelper.queryData("CREATE TABLE IF NOT EXISTS PRODUK(Id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR, price VARCHAR, image BLOB,idPetani long)");
btnChoose.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ActivityCompat.requestPermissions(
MainActivity.this,
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
REQUEST_CODE_GALLERY
);
}
});
btnAdd.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
try{
sqLiteHelper.insertData(
edtName.getText().toString().trim(),
edtPrice.getText().toString().trim(),
imageViewToByte(imageView)
);
Toast.makeText(getApplicationContext(), "Added successfully!", Toast.LENGTH_SHORT).show();
edtName.setText("");
edtPrice.setText("");
imageView.setImageResource(R.mipmap.ic_launcher);
}
catch (Exception e){
e.printStackTrace();
}
}
});
btnList.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(MainActivity.this, ProdukList.class);
startActivity(intent);
}
});
}
public static byte[] imageViewToByte(ImageView image) {
Bitmap bitmap = ((BitmapDrawable)image.getDrawable()).getBitmap();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
byte[] byteArray = stream.toByteArray();
return byteArray;
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
if(requestCode == REQUEST_CODE_GALLERY){
if(grantResults.length >0 && grantResults[0] == PackageManager.PERMISSION_GRANTED){
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent, REQUEST_CODE_GALLERY);
}
else {
Toast.makeText(getApplicationContext(), "You don't have permission to access file location!", Toast.LENGTH_SHORT).show();
}
return;
}
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if(requestCode == REQUEST_CODE_GALLERY && resultCode == RESULT_OK && data != null){
Uri uri = data.getData();
try {
InputStream inputStream = getContentResolver().openInputStream(uri);
Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
imageView.setImageBitmap(bitmap);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
super.onActivityResult(requestCode, resultCode, data);
}
private void init(){
edtName = (EditText) findViewById(R.id.edtName);
edtPrice = (EditText) findViewById(R.id.edtPrice);
btnChoose = (Button) findViewById(R.id.btnChoose);
btnAdd = (Button) findViewById(R.id.btnAdd);
btnList = (Button) findViewById(R.id.btnList);
imageView = (ImageView) findViewById(R.id.imageView);
}
}
package andreas.develops.proyek.kelompok;
public class ModelPemesanan {
public int id,id_produk,total;
public long id_pemesan,id_petani;
public String produk,tanggal;
public byte[] gambar1;
public ModelPemesanan(){
}
public ModelPemesanan(int id, int id_produk, int total, long id_pemesan, long id_petani, String produk, String tanggal, byte[] gambar1) {
this.id = id;
this.id_produk = id_produk;
this.total = total;
this.id_pemesan = id_pemesan;
this.id_petani = id_petani;
this.produk = produk;
this.tanggal = tanggal;
this.gambar1 = gambar1;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getId_produk() {
return id_produk;
}
public void setId_produk(int id_produk) {
this.id_produk = id_produk;
}
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public long getId_pemesan() {
return id_pemesan;
}
public void setId_pemesan(long id_pemesan) {
this.id_pemesan = id_pemesan;
}
public long getId_petani() {
return id_petani;
}
public void setId_petani(long id_petani) {
this.id_petani = id_petani;
}
public String getProduk() {
return produk;
}
public void setProduk(String produk) {
this.produk = produk;
}
public String getTanggal() {
return tanggal;
}
public void setTanggal(String tanggal) {
this.tanggal = tanggal;
}
public byte[] getGambar1() {
return gambar1;
}
public void setGambar1(byte[] gambar1) {
this.gambar1 = gambar1;
}
}
package andreas.develops.proyek.kelompok;
public class ModelUser {
private long id;
private String nama_user;
private String username;
private String password;
private int role;
public ModelUser() {
}
public ModelUser(long id, String nama_user, String username, String password, int role) {
this.id = id;
this.nama_user = nama_user;
this.username = username;
this.password = password;
this.role = role;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getNama_user() {
return nama_user;
}
public void setNama_user(String nama_user) {
this.nama_user = nama_user;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public int getRole() {
return role;
}
public void setRole(int role) {
this.role = role;
}
}
package andreas.develops.proyek.kelompok;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteStatement;
import static andreas.develops.proyek.kelompok.Login.idLogin;
public class PemesananHelper extends SQLiteOpenHelper {
public PemesananHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
super(context, name, factory, version);
}
public void queryData(String sql){
SQLiteDatabase database = getWritableDatabase();
database.execSQL(sql);
}
public void pemesananData(long id_pemesan,long id_petani,int id_produk,String produk,int total,String tanggal,byte[] gambar){
SQLiteDatabase database = getWritableDatabase();
String sql = "INSERT INTO PEMESANAN VALUES (NULL, ?, ?, ?, ?, ?, ?, ?)";
SQLiteStatement statement = database.compileStatement(sql);
statement.clearBindings();
statement.bindLong(1, id_pemesan);
statement.bindLong(2, id_petani);
statement.bindDouble(3, id_produk);
statement.bindString(4,produk);
statement.bindLong(5,total);
statement.bindString(6,tanggal);
statement.bindBlob(7,gambar);
statement.executeInsert();
}
@Override
public void onCreate(SQLiteDatabase db) {
}
public Cursor getData(String sql){
SQLiteDatabase database = getReadableDatabase();
return database.rawQuery(sql, null);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
}
package andreas.develops.proyek.kelompok;
import android.app.Activity;
import android.database.Cursor;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import java.util.ArrayList;
import static andreas.develops.proyek.kelompok.Login.idLogin;
public class PemesananList extends Activity {
ListView simpleList;
String countryList[] = {"Audio"};
int flags[] = {R.drawable.logo};
ArrayList<ModelPemesanan> list;
ProdukListAdapter adapter = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pemesanan_list);
list = new ArrayList<>();
simpleList = (ListView) findViewById(R.id.simpleListView);
CustomAdapter customAdapter = new CustomAdapter(this,R.layout.activity_listview1, list);
simpleList.setAdapter(customAdapter);
Cursor cursor = ProdukDetail.pemesananHelper.getData("SELECT * FROM PEMESANAN");
list.clear();
while (cursor.moveToNext()) {
int id = cursor.getInt(0);
long id_pemesan = cursor.getLong(1);
long id_petani = cursor.getLong(2);
int id_produk = cursor.getInt(3);
String produk = cursor.getString(4);
int total = cursor.getInt(5);
String tanggal = cursor.getString(6);
byte[] image = cursor.getBlob(7);
list.add(new ModelPemesanan(1,2,3,3,2,"beras","12 september",image));
}
}
}
package andreas.develops.proyek.kelompok;
import java.io.Serializable;
public class PlayerItem implements Serializable {
String no, name, Position, birth_date, Poster;
public PlayerItem(String no, String name, String Position, String Poster ) {
this.no = no;
this.name = name;
this.Position = Position;
this.Poster = Poster;
}
public String getNo() {
return no;
}
public String getName() {
return name;
}
public String getPosition() {
return Position;
}
public String getPoster() {
return Poster;
}
}
\ No newline at end of file
package andreas.develops.proyek.kelompok;
public class Produk {
private int id;
private String name;
private String price;
private byte[] image;
private int thumbnail;
public Produk(String name, String price, byte[] image, int id) {
this.name = name;
this.price = price;
this.image = image;
this.id = id;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public byte[] getImage() {
return image;
}
public void setImage(byte[] image) {
this.image = image;
}
public int getThumbnail() {
return thumbnail;
}
public void setThumbnail(int thumbnail) {
this.thumbnail = thumbnail;
}
}
package andreas.develops.proyek.kelompok;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import static andreas.develops.proyek.kelompok.Login.idLogin;
public class ProdukDetail extends AppCompatActivity {
TextView nama,harga;
ImageView gambar1;
DatabaseHandler dbh;
EditText jumlah1;
Button but;
public static PemesananHelper pemesananHelper;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_produk_detail);
but = (Button)findViewById(R.id.but);
nama = (TextView)findViewById(R.id.nama);
harga = (TextView)findViewById(R.id.harga);
gambar1 = (ImageView)findViewById(R.id.gambar);
jumlah1 = (EditText)findViewById(R.id.jumlah);
Intent intent = getIntent();
int id = intent.getExtras().getInt("id");
String nama1 = intent.getExtras().getString("nama");
String harga1 = intent.getExtras().getString("harga");
byte[] foodImage = intent.getExtras().getByteArray("gambar1");
final Bitmap bitmap = BitmapFactory.decodeByteArray(foodImage, 0, foodImage.length);
//int image1 = intent.getExtras().getInt("gambar1");
nama.setText(nama1);
harga.setText(harga1);
gambar1.setImageBitmap(bitmap);
pemesananHelper = new PemesananHelper(this,"Pemesanan1.sqlite",null,1);
pemesananHelper.queryData("CREATE TABLE IF NOT EXISTS PEMESANAN(Id INTEGER PRIMARY KEY AUTOINCREMENT, id_pemesan long, id_petani long, id_produk int,produk String , total int,tanggal String , image BLOB)");
but.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try{
Intent intent = getIntent();
pemesananHelper.pemesananData(idLogin,3,intent.getExtras().getInt("id"),intent.getExtras().getString("nama"),Integer.parseInt(jumlah1.getText().toString()),"12 asd",intent.getExtras().getByteArray("gambar1"));
Toast.makeText(getApplicationContext(),"berhasil",Toast.LENGTH_LONG).show();
}catch(Exception e){
}
}
});
}
public void tambahPemesanan(View view){
Intent intent = getIntent();
String nama1 = intent.getExtras().getString("nama");
String harga1 = intent.getExtras().getString("harga");
byte[] foodImage = intent.getExtras().getByteArray("gambar1");
Bitmap bitmap = BitmapFactory.decodeByteArray(foodImage, 0, foodImage.length);
ModelPemesanan mu = new ModelPemesanan();
mu.setId_pemesan(idLogin);
mu.setId_petani(2);
mu.setId_produk(3);
mu.setProduk("asd");
mu.setTotal(312);
mu.setTanggal("asd");
mu.setGambar1(intent.getExtras().getByteArray("gambar1"));
dbh.addPemesanan(mu);
Toast.makeText(getApplicationContext(),"Pemesanan berhasil",Toast.LENGTH_LONG).show();
}
}
package andreas.develops.proyek.kelompok;
import android.Manifest;
import android.app.Activity;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.Toast;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.ArrayList;
import static andreas.develops.proyek.kelompok.Login.idLogin;
public class ProdukList extends AppCompatActivity {
GridView gridView;
ArrayList<Produk> list;
ProdukListAdapter adapter = null;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_produk_list);
gridView = (GridView) findViewById(R.id.gridView);
list = new ArrayList<>();
adapter = new ProdukListAdapter(this, R.layout.produk_item, list);
gridView.setAdapter(adapter);
// get all data from sqlite
Cursor cursor = MainActivity.sqLiteHelper.getData("SELECT * FROM PRODUK WHERE idPetani = "+idLogin);
list.clear();
while (cursor.moveToNext()) {
int id = cursor.getInt(0);
String name = cursor.getString(1);
String price = cursor.getString(2);
byte[] image = cursor.getBlob(3);
list.add(new Produk(name, price, image, id));
}
adapter.notifyDataSetChanged();
gridView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, final int position, long id) {
CharSequence[] items = {"Update", "Delete"};
AlertDialog.Builder dialog = new AlertDialog.Builder(ProdukList.this);
dialog.setTitle("Choose an action");
dialog.setItems(items, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int item) {
if (item == 0) {
// update
Cursor c = MainActivity.sqLiteHelper.getData("SELECT id FROM PRODUK");
ArrayList<Integer> arrID = new ArrayList<Integer>();
while (c.moveToNext()){
arrID.add(c.getInt(0));
}
// show dialog update at here
showDialogUpdate(ProdukList.this, arrID.get(position));
} else {
// delete
Cursor c = MainActivity.sqLiteHelper.getData("SELECT id FROM PRODUK");
ArrayList<Integer> arrID = new ArrayList<Integer>();
while (c.moveToNext()){
arrID.add(c.getInt(0));
}
showDialogDelete(arrID.get(position));
}
}
});
dialog.show();
return true;
}
});
}
ImageView imageViewFood;
private void showDialogUpdate(Activity activity, final int position){
final Dialog dialog = new Dialog(activity);
dialog.setContentView(R.layout.update_food_activity);
dialog.setTitle("Update");
imageViewFood = (ImageView) dialog.findViewById(R.id.imageViewFood);
final EditText edtName = (EditText) dialog.findViewById(R.id.edtName);
final EditText edtPrice = (EditText) dialog.findViewById(R.id.edtPrice);
Button btnUpdate = (Button) dialog.findViewById(R.id.btnUpdate);
// set width for dialog
int width = (int) (activity.getResources().getDisplayMetrics().widthPixels * 0.95);
// set height for dialog
int height = (int) (activity.getResources().getDisplayMetrics().heightPixels * 0.7);
dialog.getWindow().setLayout(width, height);
dialog.show();
imageViewFood.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// request photo library
ActivityCompat.requestPermissions(
ProdukList.this,
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
888
);
}
});
btnUpdate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
MainActivity.sqLiteHelper.updateData(
edtName.getText().toString().trim(),
edtPrice.getText().toString().trim(),
MainActivity.imageViewToByte(imageViewFood),
position
);
dialog.dismiss();
Toast.makeText(getApplicationContext(), "Update successfully!!!",Toast.LENGTH_SHORT).show();
}
catch (Exception error) {
Log.e("Update error", error.getMessage());
}
updateFoodList();
}
});
}
private void showDialogDelete(final int idFood){
final AlertDialog.Builder dialogDelete = new AlertDialog.Builder(ProdukList.this);
dialogDelete.setTitle("Warning!!");
dialogDelete.setMessage("Are you sure you want to this delete?");
dialogDelete.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
try {
MainActivity.sqLiteHelper.deleteData(idFood);
Toast.makeText(getApplicationContext(), "Delete successfully!!!",Toast.LENGTH_SHORT).show();
} catch (Exception e){
Log.e("error", e.getMessage());
}
updateFoodList();
}
});
dialogDelete.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
dialogDelete.show();
}
private void updateFoodList(){
// get all data from sqlite
Cursor cursor = MainActivity.sqLiteHelper.getData("SELECT * FROM PRODUK");
list.clear();
while (cursor.moveToNext()) {
int id = cursor.getInt(0);
String name = cursor.getString(1);
String price = cursor.getString(2);
byte[] image = cursor.getBlob(3);
list.add(new Produk(name, price, image, id));
}
adapter.notifyDataSetChanged();
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
if(requestCode == 888){
if(grantResults.length >0 && grantResults[0] == PackageManager.PERMISSION_GRANTED){
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent, 888);
}
else {
Toast.makeText(getApplicationContext(), "You don't have permission to access file location!", Toast.LENGTH_SHORT).show();
}
return;
}
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if(requestCode == 888 && resultCode == RESULT_OK && data != null){
Uri uri = data.getData();
try {
InputStream inputStream = getContentResolver().openInputStream(uri);
Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
imageViewFood.setImageBitmap(bitmap);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
super.onActivityResult(requestCode, resultCode, data);
}
}
package andreas.develops.proyek.kelompok;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
/**
* Created by Quoc Nguyen on 13-Dec-16.
*/
public class ProdukListAdapter extends BaseAdapter {
private Context context;
private int layout;
private ArrayList<Produk> foodsList;
public ProdukListAdapter(Context context, int layout, ArrayList<Produk> foodsList) {
this.context = context;
this.layout = layout;
this.foodsList = foodsList;
}
@Override
public int getCount() {
return foodsList.size();
}
@Override
public Object getItem(int position) {
return foodsList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
private class ViewHolder{
ImageView imageView;
TextView txtName, txtPrice;
}
@Override
public View getView(int position, View view, ViewGroup viewGroup) {
View row = view;
ViewHolder holder = new ViewHolder();
if(row == null){
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
row = inflater.inflate(layout, null);
holder.txtName = (TextView) row.findViewById(R.id.txtName);
holder.txtPrice = (TextView) row.findViewById(R.id.txtPrice);
holder.imageView = (ImageView) row.findViewById(R.id.imgFood);
row.setTag(holder);
}
else {
holder = (ViewHolder) row.getTag();
}
Produk food = foodsList.get(position);
holder.txtName.setText(food.getName());
holder.txtPrice.setText(food.getPrice());
byte[] foodImage = food.getImage();
Bitmap bitmap = BitmapFactory.decodeByteArray(foodImage, 0, foodImage.length);
holder.imageView.setImageBitmap(bitmap);
return row;
}
}
package andreas.develops.proyek.kelompok;
import android.Manifest;
import android.app.Activity;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.Toast;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.ArrayList;
public class ProdukListCustomer extends AppCompatActivity {
GridView gridView;
ArrayList<Produk> list;
ProdukListAdapter adapter = null;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_produk_list);
gridView = (GridView) findViewById(R.id.gridView);
list = new ArrayList<>();
adapter = new ProdukListAdapter(this, R.layout.produk_item, list);
gridView.setAdapter(adapter);
// get all data from sqlite
Cursor cursor = MainActivity.sqLiteHelper.getData("SELECT * FROM PRODUK");
list.clear();
while (cursor.moveToNext()) {
int id = cursor.getInt(0);
String name = cursor.getString(1);
String price = cursor.getString(2);
byte[] image = cursor.getBlob(3);
list.add(new Produk(name, price, image, id));
}
adapter.notifyDataSetChanged();
gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Toast.makeText(getApplicationContext(),list.get(position).getName(),Toast.LENGTH_LONG).show();
Intent mainIntent = new Intent(ProdukListCustomer.this,ProdukDetail.class);
mainIntent.putExtra("id",list.get(position).getId());
mainIntent.putExtra("nama",list.get(position).getName());
mainIntent.putExtra("harga",list.get(position).getPrice());
mainIntent.putExtra("gambar1",list.get(position).getImage());
startActivity(mainIntent);
}
});
}
ImageView imageViewFood;
private void showDialogUpdate(Activity activity, final int position){
final Dialog dialog = new Dialog(activity);
dialog.setContentView(R.layout.update_food_activity);
dialog.setTitle("Update");
imageViewFood = (ImageView) dialog.findViewById(R.id.imageViewFood);
final EditText edtName = (EditText) dialog.findViewById(R.id.edtName);
final EditText edtPrice = (EditText) dialog.findViewById(R.id.edtPrice);
Button btnUpdate = (Button) dialog.findViewById(R.id.btnUpdate);
// set width for dialog
int width = (int) (activity.getResources().getDisplayMetrics().widthPixels * 0.95);
// set height for dialog
int height = (int) (activity.getResources().getDisplayMetrics().heightPixels * 0.7);
dialog.getWindow().setLayout(width, height);
dialog.show();
imageViewFood.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// request photo library
ActivityCompat.requestPermissions(
ProdukListCustomer.this,
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
888
);
}
});
btnUpdate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
MainActivity.sqLiteHelper.updateData(
edtName.getText().toString().trim(),
edtPrice.getText().toString().trim(),
MainActivity.imageViewToByte(imageViewFood),
position
);
dialog.dismiss();
Toast.makeText(getApplicationContext(), "Update successfully!!!",Toast.LENGTH_SHORT).show();
}
catch (Exception error) {
Log.e("Update error", error.getMessage());
}
updateFoodList();
}
});
}
private void showDialogDelete(final int idFood){
final AlertDialog.Builder dialogDelete = new AlertDialog.Builder(ProdukListCustomer.this);
dialogDelete.setTitle("Warning!!");
dialogDelete.setMessage("Are you sure you want to this delete?");
dialogDelete.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
try {
MainActivity.sqLiteHelper.deleteData(idFood);
Toast.makeText(getApplicationContext(), "Delete successfully!!!",Toast.LENGTH_SHORT).show();
} catch (Exception e){
Log.e("error", e.getMessage());
}
updateFoodList();
}
});
dialogDelete.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
dialogDelete.show();
}
private void updateFoodList(){
// get all data from sqlite
Cursor cursor = MainActivity.sqLiteHelper.getData("SELECT * FROM PRODUK");
list.clear();
while (cursor.moveToNext()) {
int id = cursor.getInt(0);
String name = cursor.getString(1);
String price = cursor.getString(2);
byte[] image = cursor.getBlob(3);
list.add(new Produk(name, price, image, id));
}
adapter.notifyDataSetChanged();
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
if(requestCode == 888){
if(grantResults.length >0 && grantResults[0] == PackageManager.PERMISSION_GRANTED){
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent, 888);
}
else {
Toast.makeText(getApplicationContext(), "You don't have permission to access file location!", Toast.LENGTH_SHORT).show();
}
return;
}
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if(requestCode == 888 && resultCode == RESULT_OK && data != null){
Uri uri = data.getData();
try {
InputStream inputStream = getContentResolver().openInputStream(uri);
Bitmap bitmap = BitmapFactory.decodeStream(inputStream);
imageViewFood.setImageBitmap(bitmap);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
super.onActivityResult(requestCode, resultCode, data);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.optionmenu, menu);
//getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId()==R.id.logout){
startActivity(new Intent(this, Login.class));
}
else if (item.getItemId()==R.id.listView){
startActivity(new Intent(this, PemesananList.class));
}else if (item.getItemId()==R.id.firebase){
startActivity(new Intent(this, firebase.class));
}
else if (item.getItemId()==R.id.baterai){
startActivity(new Intent(this, Broadcast.class));
}else if (item.getItemId()==R.id.nomor){
startActivity(new Intent(this, ContentProvider.class));
}else if (item.getItemId()==R.id.About){
startActivity(new Intent(this, About.class));
}else if (item.getItemId()==R.id.pemesanan){
startActivity(new Intent(this, PemesananList.class));
}
return true;
}
}
package andreas.develops.proyek.kelompok;
import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;
public class Registrasi extends AppCompatActivity {
EditText nama, username, password;
DatabaseHandler dbh;
Registrasi a;
public static int userRole;
Spinner spinnerDropDownView;
String[] spinnerValueHoldValue = {"Customer", "Petani"};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_registrasi);
nama = (EditText)findViewById(R.id.nama);
username = (EditText) findViewById(R.id.username);
password = (EditText) findViewById(R.id.password);
a = this;
dbh = new DatabaseHandler(a);
spinnerDropDownView =(Spinner)findViewById(R.id.spinner1);
ArrayAdapter<String> adapter = new ArrayAdapter<>(Registrasi.this, android.R.layout.simple_list_item_1, spinnerValueHoldValue);
spinnerDropDownView.setAdapter(adapter);
spinnerDropDownView.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
Toast.makeText(Registrasi.this, spinnerDropDownView.getSelectedItem().toString(), Toast.LENGTH_LONG).show();
if(spinnerDropDownView.getSelectedItem().equals("Customer")){
userRole = 2;
}else {
userRole = 1;
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
public void daftar(View view) {
ModelUser mu = new ModelUser();
mu.setNama_user(nama.getText().toString());
mu.setUsername(username.getText().toString());
mu.setPassword(password.getText().toString());
mu.setRole(userRole);
dbh.addUser(mu);
Toast.makeText(getApplicationContext(), "Anda berhasil ditambahkan dan akan kembali dalam 2 detik", Toast.LENGTH_SHORT).show();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
final Intent mainIntent = new Intent(getApplicationContext(),
Login.class);
startActivity(mainIntent);
finish();
}
}, 2000);//delay 5 detik
}
}
\ No newline at end of file
package andreas.develops.proyek.kelompok;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteStatement;
import static andreas.develops.proyek.kelompok.Login.idLogin;
public class SQLiteHelper extends SQLiteOpenHelper {
Login login = new Login();
public SQLiteHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
super(context, name, factory, version);
}
public void queryData(String sql){
SQLiteDatabase database = getWritableDatabase();
database.execSQL(sql);
}
public void insertData(String name, String price, byte[] image){
SQLiteDatabase database = getWritableDatabase();
String sql = "INSERT INTO PRODUK VALUES (NULL, ?, ?, ?, ?)";
SQLiteStatement statement = database.compileStatement(sql);
statement.clearBindings();
statement.bindString(1, name);
statement.bindString(2, price);
statement.bindBlob(3, image);
statement.bindLong(4,idLogin);
statement.executeInsert();
}
public void updateData(String name, String price, byte[] image, int id) {
SQLiteDatabase database = getWritableDatabase();
String sql = "UPDATE PRODUK SET name = ?, price = ?, image = ?,idPetani = ? WHERE id = ?";
SQLiteStatement statement = database.compileStatement(sql);
statement.bindString(1, name);
statement.bindString(2, price);
statement.bindBlob(3, image);
statement.bindDouble(4, (double)id);
statement.execute();
database.close();
}
public void deleteData(int id) {
SQLiteDatabase database = getWritableDatabase();
String sql = "DELETE FROM PRODUK WHERE id = ?";
SQLiteStatement statement = database.compileStatement(sql);
statement.clearBindings();
statement.bindDouble(1, (double)id);
statement.execute();
database.close();
}
public Cursor getData(String sql){
SQLiteDatabase database = getReadableDatabase();
return database.rawQuery(sql, null);
}
@Override
public void onCreate(SQLiteDatabase sqLiteDatabase) {
}
@Override
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
}
}
package andreas.develops.proyek.kelompok;
import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
public class Splashscreen extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splashscreen);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
final Intent mainInten = new Intent(getApplicationContext(), Login.class);
startActivity(mainInten);
finish();
}
}, 6000);
}
@Override
protected void onStart() {
super.onStart();
ImageView image = (ImageView) findViewById(R.id.imageView);
Animation animation1 = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.blink);
image.startAnimation(animation1);
}
}
\ No newline at end of file
package andreas.develops.proyek.kelompok;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
public class firebase extends AppCompatActivity {
EditText editTextSearch;
Button btnSearch;
TextView txtResults;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_firebase);
editTextSearch = (EditText)findViewById(R.id.editTxtSearch);
btnSearch = (Button)findViewById(R.id.btnSubmit);
txtResults = (TextView)findViewById(R.id.txtViewResult);
btnSearch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(TextUtils.isEmpty(editTextSearch.getText().toString())){
Toast.makeText(firebase.this,"No empty Keyword",Toast.LENGTH_SHORT).show();
}else{
DatabaseReference mRef = FirebaseDatabase.getInstance().getReference("meaning");
mRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
String searKeyword = editTextSearch.getText().toString();
if(dataSnapshot.child(searKeyword).exists()){
txtResults.setText(dataSnapshot.child(searKeyword).getValue().toString());
}else{
Toast.makeText(firebase.this,"No search Result",Toast.LENGTH_SHORT).show();
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
}
}
});
}
}
package andreas.develops.proyek.kelompok;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class listview1 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_listview1);
}
}
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha
android:duration="600"
android:fromAlpha="0.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:repeatCount="infinite"
android:repeatMode="reverse"
android:toAlpha="1.0" />
</set>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeWidth="1"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#008577"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
tools:context=".About">
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
\ No newline at end of file
<?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:context=".Broadcast">
<TextView
android:id="@+id/batteryLevel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Battery Level : " />
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleHorizontal"
android:max="100"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/batteryLevel"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
\ No newline at end of file
<?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:context=".ContentProvider">
<TextView
android:id="@+id/contact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"/>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:background="@drawable/back"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".firebase">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Search Keyword.."
android:id="@+id/editTxtSearch"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Search"
android:id="@+id/btnSubmit"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/txtViewResult"/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="horizontal"
tools:context=".listview1">
<ImageView
android:id="@+id/icon"
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/images" />
<TextView
android:id="@+id/textView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="@dimen/activity_horizontal_margin"
android:textColor="@color/colorSecunder" />
<Button
android:id="@+id/beli"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Beli"
/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nestedScrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/back"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".Login">
<android.support.v7.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center_horizontal"
android:src="@drawable/go"/>
<android.support.design.widget.TextInputLayout
android:id="@+id/textInputLayoutEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp" >
<android.support.design.widget.TextInputEditText
android:id="@+id/uss"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_email"
android:textColorHint="@color/colorText"
android:inputType="text"
android:maxLines="1"
android:textColor="@color/colorText" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/textInputLayoutPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp" >
<android.support.design.widget.TextInputEditText
android:id="@+id/pass"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_password"
android:textColorHint="@color/colorText"
android:inputType="textPassword"
android:maxLines="1"
android:textColor="@color/colorText" />
</android.support.design.widget.TextInputLayout>
<android.support.v7.widget.AppCompatButton
android:id="@+id/btn_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:textColor="@color/colorText"
android:background="@color/colorTextHint"
android:onClick="login"
android:text="@string/text_login" />
<android.support.v7.widget.AppCompatTextView
android:id="@+id/textViewLinkRegister"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:gravity="center"
android:text="@string/text_not_member"
android:textSize="16sp"
android:onClick="daftar"
android:textColor="@color/colorText" />
</android.support.v7.widget.LinearLayoutCompat>
</android.support.v4.widget.NestedScrollView>
<?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:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
<EditText
android:id="@+id/edtPrice"
android:layout_width="348dp"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginStart="24dp"
android:layout_marginTop="76dp"
android:ems="10"
android:inputType="textPersonName"
android:hint="Harga Produk"
tools:layout_editor_absoluteX="16dp"
tools:layout_editor_absoluteY="16dp" />
<EditText
android:id="@+id/edtName"
android:layout_width="345dp"
android:layout_height="wrap_content"
android:layout_alignEnd="@+id/edtPrice"
android:layout_alignParentTop="true"
android:layout_marginTop="18dp"
android:layout_marginEnd="2dp"
android:ems="10"
android:inputType="textPersonName"
android:hint="Nama Produk"
tools:layout_editor_absoluteX="16dp"
tools:layout_editor_absoluteY="82dp" />
<ImageView
android:id="@+id/imageView"
android:layout_width="74dp"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/edtPrice"
android:layout_alignTop="@+id/btnChoose"
android:layout_marginStart="-21dp"
android:layout_marginTop="-77dp"
app:srcCompat="@mipmap/ic_launcher"
tools:layout_editor_absoluteX="38dp"
tools:layout_editor_absoluteY="173dp" />
<Button
android:id="@+id/btnChoose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="251dp"
android:layout_marginEnd="-119dp"
android:text="choose image"
tools:layout_editor_absoluteX="170dp"
tools:layout_editor_absoluteY="196dp" />
<Button
android:id="@+id/btnAdd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="126dp"
android:text="add"
tools:layout_editor_absoluteX="138dp"
tools:layout_editor_absoluteY="286dp" />
<Button
android:id="@+id/btnList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="133dp"
android:layout_marginBottom="35dp"
android:text="Produk saya"
tools:layout_editor_absoluteX="137dp"
tools:layout_editor_absoluteY="379dp" />
</RelativeLayout>
\ No newline at end of file
<?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"
android:background="@drawable/back"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".PemesananList">
<TextView
android:id="@+id/textList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Daftar Pemesanan"
android:gravity="center_horizontal"
android:textColor="@color/colorAccent"
android:textSize="30dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/simpleListView"
android:layout_marginTop="30dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:divider="@color/colorAccent"
android:dividerHeight="1dp" />
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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:background="@android:color/white"
tools:context=".ProdukDetail">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/nama"
android:layout_width="wrap_content"
android:textStyle="bold"
android:textSize="35dp"
android:textColor="@color/colorPrimaryDark"
android:typeface="serif"
android:textAlignment="center"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
<TextView
android:id="@+id/tvdesc"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/gambar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:scaleType="fitXY"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:text="@string/_1_photos"
android:gravity="center_vertical"
android:drawablePadding="4dp"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:background="#4D000000"
android:textColor="@android:color/white"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_gravity="bottom" />
</FrameLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="25dp"
android:gravity="center"
android:layout_marginHorizontal="@dimen/activity_horizontal_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:background="@color/colorAccent"
android:text="Detail Produk"/>
<TextView
android:id="@+id/harga"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:textSize="32sp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/stock_hanya_5_buah"
android:textSize="12sp"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginBottom="@dimen/activity_vertical_margin"/>
<RatingBar
android:id="@+id/simpleRatingBar"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_centerHorizontal="true"
android:rating="4" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginBottom="@dimen/activity_vertical_margin">
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_marginRight="@dimen/activity_vertical_margin"
android:text="@string/display"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_weight="1"
android:text="@string/content_specs_display"
android:textColor="@android:color/black"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_marginRight="@dimen/activity_vertical_margin"
android:text="@string/size"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_weight="1"
android:text="@string/content_specs_size"
android:textColor="@android:color/black"/>
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_marginRight="@dimen/activity_vertical_margin"
android:text="informasi"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/content_text"
android:textColor="@android:color/black"
android:textSize="14sp" />
</TableRow>
</TableLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Isi Data Diri"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:gravity="center"
android:textSize="25dp"
android:background="@color/colorAccent"/>
</RelativeLayout>
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginBottom="@dimen/activity_vertical_margin">
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/activity_vertical_margin"
android:text="Nama"
android:textSize="14sp" />
<EditText
android:layout_width="300dp"
android:layout_height="wrap_content" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/activity_vertical_margin"
android:text="Jumlah"
android:textSize="14sp" />
<EditText
android:id="@+id/jumlah"
android:layout_width="300dp"
android:layout_height="wrap_content" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/activity_vertical_margin"
android:text="Varian"
android:textSize="14sp" />
<Spinner
android:id="@+id/spnPilih"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/array_colors" />
</TableRow>
</TableLayout>
<Button
android:id="@+id/but"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Beli"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:textSize="20dp"/>
</LinearLayout>
</ScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" >
<GridView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/gridView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:columnWidth="120dp"
android:gravity="center"
android:numColumns="2" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" >
<GridView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/gridView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:columnWidth="120dp"
android:gravity="center"
android:numColumns="2" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/nestedScrollView"
android:background="@drawable/back"
android:padding="20dp"
tools:context=".Registrasi">
<android.support.v7.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.AppCompatImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="40dp"
android:src="@drawable/go" />
<android.support.design.widget.TextInputLayout
android:id="@+id/textInputLayoutName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp" >
<android.support.design.widget.TextInputEditText
android:id="@+id/nama"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_name"
android:textColorHint="@color/colorText"
android:inputType="text"
android:maxLines="1"
android:textColor="@color/colorText" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/textInputLayoutEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp" >
<android.support.design.widget.TextInputEditText
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Username"
android:textColorHint="@color/colorText"
android:inputType="text"
android:maxLines="1"
android:textColor="@color/colorText" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/textInputLayoutPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp" >
<android.support.design.widget.TextInputEditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_password"
android:textColorHint="@color/colorText"
android:inputType="textPassword"
android:maxLines="1"
android:textColor="@color/colorText" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/textInputLayoutConfirmPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<Spinner
android:id="@+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="60dp" />
</android.support.design.widget.TextInputLayout>
<android.support.v7.widget.AppCompatButton
android:id="@+id/daftar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:textColor="@color/colorText"
android:background="@color/colorTextHint"
android:onClick="daftar"
android:text="@string/text_register" />
<android.support.v7.widget.AppCompatTextView
android:id="@+id/appCompatTextViewLoginLink"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:gravity="center"
android:text="@string/text_member"
android:textSize="16sp"
android:textColor="@color/colorText" />
</android.support.v7.widget.LinearLayoutCompat>
</android.support.v4.widget.NestedScrollView>
\ No newline at end of file
<?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"
android:background="@drawable/kebun"
tools:context=".Splashscreen">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="150dp"
android:layout_marginTop="350px"
android:layout_centerHorizontal="true"
android:src="@drawable/go" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:id="@+id/listItem"
android:orientation="horizontal">
<LinearLayout
android:layout_weight="0.5"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/Poster"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_marginLeft="8dp"
android:layout_weight="1"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:textColor="#000000"
android:text="no"
android:id="@+id/textViewNo"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:textColor="#000000"
android:text="name"
android:id="@+id/textViewName"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:textColor="#000000"
android:text="position"
android:id="@+id/textViewPosition"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?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"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="150dp"
android:layout_height="150dp"
app:srcCompat="@mipmap/ic_launcher"
android:id="@+id/imgFood"
android:layout_marginLeft="25dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/txtName"
android:text="Food name"
android:textSize="17sp"
android:textColor="#0e11d1"
android:layout_below="@+id/imgFood"
android:textAlignment="center"
android:layout_alignRight="@+id/imgFood"
android:layout_alignEnd="@+id/imgFood"
android:layout_marginRight="33dp"
android:layout_marginEnd="33dp" />
<TextView
android:text="Price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/txtPrice"
android:textSize="17sp"
android:textColor="#ce1309"
android:textAlignment="center"
android:layout_below="@+id/txtName"
android:layout_alignRight="@+id/txtName"
android:layout_alignEnd="@+id/txtName"
android:layout_marginRight="30dp"
android:layout_marginEnd="30dp" />
</RelativeLayout>
\ No newline at end of file
<?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"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:hint="Price"
android:ems="10"
android:id="@+id/edtPrice"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<EditText
android:id="@+id/edtName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:ems="10"
android:hint="Name"
android:layout_above="@+id/edtPrice"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="17dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<Button
android:text="Update"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/btnUpdate"
android:layout_marginTop="32dp"
android:background="#265dc4"
android:textColor="#ffffff"
android:layout_below="@+id/edtPrice"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
app:srcCompat="@mipmap/ic_launcher"
android:layout_marginLeft="113dp"
android:layout_marginStart="113dp"
android:id="@+id/imageViewFood"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/listView"
android:title="ListView"
app:showAsAction="never"/>
<item
android:id="@+id/baterai"
android:title="Baterai"
app:showAsAction="never"/>
<item
android:id="@+id/nomor"
android:title="Nomor Kontak"
app:showAsAction="never"/>
<item
android:id="@+id/firebase"
android:title="Cari arti"
app:showAsAction="never"/>
<item
android:id="@+id/About"
android:title="About"
app:showAsAction="never"/>
<item
android:id="@+id/pemesanan"
android:title="Pemesanan"
app:showAsAction="never"/>
<item
android:id="@+id/logout"
android:title="Logout"
app:showAsAction="never"/>
</menu>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="colorText">#FFFFFF</color>
<color name="colorTextHint">#51d8c7</color>
<color name="colorSecunder">#FFC312</color>
<color name="black_overlay">#66000000</color>
<color name="green">#42f471</color>
</resources>
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="nav_header_vertical_spacing">8dp</dimen>
<dimen name="nav_header_height">176dp</dimen>
<dimen name="fab_margin">16dp</dimen>
</resources>
\ No newline at end of file
<resources>
<string name="app_name">Terminal Agro</string>
<string name="title">ActivityUtama1</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
<string name="nav_header_title">Android Studio</string>
<string name="nav_header_subtitle">android.studio@android.com</string>
<string name="nav_header_desc">Navigation header</string>
<string name="action_settings">Settings</string>
<string name="hint_name">Name</string>
<string name="hint_email">Email</string>
<string name="hint_password">Password</string>
<string name="hint_confirm_password">Confirm Password</string>
<string name="text_login">Login</string>
<string name="text_register">Register</string>
<string name="error_message_name">Enter Full Name</string>
<string name="error_message_email">Enter Valid Email</string>
<string name="error_message_age">Enter Age</string>
<string name="error_message_password">Enter Password</string>
<string name="success_message">Registration Successful</string>
<string name="text_not_member">No account yet? Create one</string>
<string name="text_already_member">Already a member? Login</string>
<string name="error_email_exists">Email Already Exists</string>
<string name="error_password_match">Password Does Not Matches</string>
<string name="error_valid_email_password">Wrong Email or Password</string>
<string name="text_member">Already a member? Login</string>
<string name="title_activity_login">Sign in</string>
<string name="prompt_email">Email</string>
<string name="prompt_password">Password</string>
<string name="action_sign_in">Sign in or register</string>
<string name="action_sign_in_short">Sign in</string>
<string name="welcome">"Welcome !"</string>
<string name="invalid_username">Not a valid username</string>
<string name="invalid_password">Password must be >5 characters</string>
<string name="login_failed">"Login failed"</string>
<string name="login">Login</string>
<string name="username">Username</string>
<string name="password">Password</string>
<string name="masuk">Masuk</string>
<string name="title_activity_home">Home</string>
<string name="tambah_motor">Tambah Motor</string>
<string name="merek_motor">Merek Motor</string>
<string name="harga_motor">Harga Motor</string>
<string name="title_activity_fullscreen">FullscreenActivity</string>
<string name="dummy_button">Dummy Button</string>
<string name="dummy_content">DUMMY\nCONTENT</string>
<string name="lama_pemakaian">Lama Pemakaian</string>
<string name="title_activity_main">MainActivity</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="app_name1">MyViewAndViews</string>
<string name="content_text">* Produk Original Berlabel ,100% asli,Realpict atau foto asli,*Kualitas barang kami usahakan yang terbaik
dengan harga termurah,*Dilarang mencuri foto Realpict suplier busan terkecuali Reseller
,*Selama stok tersedia bisa diorder tidak perlu tanya stok,* Kemungkinan akan ada sedikit perbedaan warna dalam satu model
karena efek cahaya atau perbedaan waktu produksi
*Setelah Transfer wajib melakukan konfirmasi pembayaran ke aplikasi
*Pengiriman Via JNE dan POS,untuk pembelian partai besar ekspedisi bisa request ke admin
*Pengiriman dihari ke-2 atau maksimal 3 hari setelah proses.</string>
<string name="content_specs_display">5.0 inches\n
FHD AMOLED at 441ppi\n
2.5D Corning® Gorilla® Glass 4</string>
<string name="content_specs_size">5.6 x 2.7 x 0.2 ~ 0.3 inches 143.8 x 69.5 x 7.3 ~ 8.5 mm</string>
<string name="content_specs_battery">2,770 mAh battery\n
Standby time (LTE): up to 19 days\n
Talk time (3g/WCDMA): up to 26 hours\n
Internet use time (Wi-Fi): up to 13 hours\n
Internet use time (LTE): up to 13 hours\n
Video playback: up to 13 hours\n
Audio playback (via headset): up to 110 hours\n
Fast charging: up to 7 hours of use from only 15 minutes of charging</string>
<string name="battery">Battery</string>
<string name="display">Display</string>
<string name="size">Size</string>
<string name="spesifikasi">Spesifikasi</string>
<string name="stock_hanya_5_buah">Stock hanya 5 buah</string>
<string name="_735">$735</string>
<string name="_1_photos">1 Photos</string>
<string name="title_activity_utama1">utama1</string>
<string-array name="array_colors">
<item>Merah</item>
<item>Putih</item>
<item>Kuning</item>
<item>Hitam</item>
<item>Hijau</item>
<item>Abu-abu</item>
<item>Biru</item>
</string-array>
</resources>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
package andreas.develops.proyek.kelompok;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
\ No newline at end of file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
include ':app'
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