diff --git a/System3PJagung/.gitignore b/System3PJagung/.gitignore new file mode 100644 index 0000000..c6cbe56 --- /dev/null +++ b/System3PJagung/.gitignore @@ -0,0 +1,8 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures diff --git a/System3PJagung/.idea/.name b/System3PJagung/.idea/.name new file mode 100644 index 0000000..6893359 --- /dev/null +++ b/System3PJagung/.idea/.name @@ -0,0 +1 @@ +System 3P Jagung \ No newline at end of file diff --git a/System3PJagung/.idea/compiler.xml b/System3PJagung/.idea/compiler.xml new file mode 100644 index 0000000..96cc43e --- /dev/null +++ b/System3PJagung/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/System3PJagung/.idea/copyright/profiles_settings.xml b/System3PJagung/.idea/copyright/profiles_settings.xml new file mode 100644 index 0000000..e7bedf3 --- /dev/null +++ b/System3PJagung/.idea/copyright/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/System3PJagung/.idea/dictionaries/Jafar.xml b/System3PJagung/.idea/dictionaries/Jafar.xml new file mode 100644 index 0000000..1ffcb27 --- /dev/null +++ b/System3PJagung/.idea/dictionaries/Jafar.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/System3PJagung/.idea/encodings.xml b/System3PJagung/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/System3PJagung/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/System3PJagung/.idea/gradle.xml b/System3PJagung/.idea/gradle.xml new file mode 100644 index 0000000..fc132b2 --- /dev/null +++ b/System3PJagung/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/System3PJagung/.idea/inspectionProfiles/Project_Default.xml b/System3PJagung/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..6a840f5 --- /dev/null +++ b/System3PJagung/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/System3PJagung/.idea/inspectionProfiles/profiles_settings.xml b/System3PJagung/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..3b31283 --- /dev/null +++ b/System3PJagung/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/System3PJagung/.idea/misc.xml b/System3PJagung/.idea/misc.xml new file mode 100644 index 0000000..110cb0f --- /dev/null +++ b/System3PJagung/.idea/misc.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/System3PJagung/.idea/modules.xml b/System3PJagung/.idea/modules.xml new file mode 100644 index 0000000..480db18 --- /dev/null +++ b/System3PJagung/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/System3PJagung/.idea/runConfigurations.xml b/System3PJagung/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/System3PJagung/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/System3PJagung/.idea/vcs.xml b/System3PJagung/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/System3PJagung/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/System3PJagung/app/.gitignore b/System3PJagung/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/System3PJagung/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/System3PJagung/app/build.gradle b/System3PJagung/app/build.gradle new file mode 100644 index 0000000..a6b3ef9 --- /dev/null +++ b/System3PJagung/app/build.gradle @@ -0,0 +1,28 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 23 + buildToolsVersion '23.0.1' + + defaultConfig { + applicationId "com.jafar.jaservtech.system3pjagung" + minSdkVersion 16 + targetSdkVersion 23 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(include: ['*.jar'], dir: 'libs') + compile 'com.android.support:appcompat-v7:23.1.1' + compile 'com.android.support:support-v4:23.1.1' + compile 'com.android.support:recyclerview-v7:23.1.1' + compile 'com.android.support:design:23.1.1' +} diff --git a/System3PJagung/app/proguard-rules.pro b/System3PJagung/app/proguard-rules.pro new file mode 100644 index 0000000..2a16782 --- /dev/null +++ b/System3PJagung/app/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in C:\Users\Jafar\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# 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 *; +#} diff --git a/System3PJagung/app/src/androidTest/java/com/jafar/jaservtech/system3pjagung/ApplicationTest.java b/System3PJagung/app/src/androidTest/java/com/jafar/jaservtech/system3pjagung/ApplicationTest.java new file mode 100644 index 0000000..4112b5f --- /dev/null +++ b/System3PJagung/app/src/androidTest/java/com/jafar/jaservtech/system3pjagung/ApplicationTest.java @@ -0,0 +1,13 @@ +package com.jafar.jaservtech.system3pjagung; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * Testing Fundamentals + */ +public class ApplicationTest extends ApplicationTestCase { + public ApplicationTest() { + super(Application.class); + } +} \ No newline at end of file diff --git a/System3PJagung/app/src/main/AndroidManifest.xml b/System3PJagung/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..293adff --- /dev/null +++ b/System3PJagung/app/src/main/AndroidManifest.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/CheckingComponentUser.java b/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/CheckingComponentUser.java new file mode 100644 index 0000000..7fb803c --- /dev/null +++ b/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/CheckingComponentUser.java @@ -0,0 +1,91 @@ +package com.jafar.jaservtech.system3pjagung; + +import android.annotation.SuppressLint; +import android.content.Intent; +import android.support.v7.app.ActionBar; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.os.Handler; +import android.view.MotionEvent; +import android.view.View; +import android.widget.TextView; +import com.jafar.jaservtech.system3pjagung.dummy.DBHandler; + +/** + * An example full-screen activity that shows and hides the system UI (i.e. + * status bar and navigation/system bar) with user interaction. + */ +public class CheckingComponentUser extends AppCompatActivity { + protected TextView progressMessage; + protected int codeNext; + protected int SPLASH_TIME = 3000; + + @Override + public void onCreate(Bundle savedInstancestate) { + super.onCreate(savedInstancestate); + setContentView(R.layout.activity_checking_component_user); + this.progressMessage = (TextView) findViewById(R.id.progressMessage); + + new Handler().postDelayed(new Runnable() { + + /* + * Showing splash screen with a timer. This will be useful when you + * want to show case your app logo / company + */ + + @Override + public void run() { + // This method will be executed once the timer is over + // Start your app main activity + DBHandler test = new DBHandler(CheckingComponentUser.this); + Intent i = new Intent(CheckingComponentUser.this, HomeOfSystem.class); + startActivity(i); + + // close this activity + finish(); + } + }, SPLASH_TIME); + } +} +/* + + Thread threadMe = new Thread(){ + private int codeNext; + public void run(){ + try{ + sleep(1000); + progressMessage.setText("Checking table ..."); + int j=0; + while(j<=10) { + sleep(100); + j++; + } + + // SQLJaservTech testAccount = new SQLJaservTech(CheckingComponentUser.this,null,null,1); + // codeNext= testAccount.totalrow("SELECT * FROM user_active"); + + + + }catch (Exception e){ + + }finally { + Intent control = new Intent(CheckingComponentUser.this,HomeOfSystem.class); + startActivity(control); + finish(); +/* + Intent control; + if(codeNext >= 1) + control = new Intent(MainActivity.this,ControlFirst.class); + else + control = new Intent(MainActivity.this,SignUpFirst.class); + + startActivity(control); + finish(); + *//* + } + } + }; + threadMe.start(); + } +} + */ diff --git a/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/CreateProgressDefault.java b/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/CreateProgressDefault.java new file mode 100644 index 0000000..b9091c6 --- /dev/null +++ b/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/CreateProgressDefault.java @@ -0,0 +1,243 @@ +package com.jafar.jaservtech.system3pjagung; + +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; +import android.annotation.TargetApi; +import android.os.Build; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.view.View; +import android.widget.AutoCompleteTextView; +import android.widget.Button; +import android.widget.EditText; +import android.widget.Toast; + +import com.jafar.jaservtech.system3pjagung.dummy.DBHandler; +import com.jafar.jaservtech.system3pjagung.dummy.JaservTechFilter; +import com.jafar.jaservtech.system3pjagung.dummy.Progress; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * A login screen that offers login via email/password. + */ +public class CreateProgressDefault extends AppCompatActivity { + + // UI references. + private AutoCompleteTextView mEmailView; + private EditText mPasswordView; + private View mProgressView; + private View mLoginFormView; + private EditText nama, alamat, informer; + private Button submit; + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_create_progress_default); + nama = (EditText) findViewById(R.id.nama); + alamat = (EditText) findViewById(R.id.alamat); + informer = (EditText) findViewById(R.id.auth); + submit = (Button) findViewById(R.id.email_sign_in_button); + submit.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + attemptLogin(); + } + }); + mLoginFormView = (View)findViewById(R.id.login_form); + mProgressView = (View)findViewById(R.id.login_progress); + } + + + /** + * Callback received when a permissions request has been completed. + */ + /** + * Set up the {@link android.app.ActionBar}, if the API is available. + */ + @TargetApi(Build.VERSION_CODES.HONEYCOMB) + private void setupActionBar() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + // Show the Up button in the action bar. + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + } + } + + /** + * Attempts to sign in or register the account specified by the login form. + * If there are form errors (invalid email, missing fields, etc.), the + * errors are presented and no actual login attempt is made. + */ + private void attemptLogin() { + // Reset errors. + nama.setError(null); + alamat.setError(null); + informer.setError(null); + + boolean cancel = false; + View focusView = null; + // Store values at the time of the login attempt. + String namaS = nama.getText().toString(); + String alamatS = alamat.getText().toString(); + String informerS = informer.getText().toString(); + if(JaservTechFilter.isEmpty(namaS)){ + nama.setError("Nama progress Wajib diisi"); + cancel = true; + focusView = nama; + }else if(!JaservTechFilter.isNameFieldValid(namaS)){ + nama.setError("hanya : (A-Z a-z)"); + cancel = true; + focusView = nama; + }else if(JaservTechFilter.isContainMoreSpace(namaS)){ + nama.setError("mengandung double spasi"); + focusView = nama; + cancel = true; + } + if(JaservTechFilter.isEmpty(alamatS)){ + alamat.setError("Lokasi Ladang wajib diisi"); + cancel = true; + if(focusView == null){ + focusView = alamat; + } + }else if(!JaservTechFilter.isAddressValid(alamatS)){ + alamat.setError("hanya : (A-Z,a-z.0-9)"); + cancel = true; + if(focusView == null){ + focusView = alamat; + } + }else if(JaservTechFilter.isContainMoreSpace(alamatS)){ + alamat.setError("mengandung double spasi"); + cancel = true; + if(focusView == null){ + focusView = alamat; + } + } + + if(JaservTechFilter.isEmpty(informerS)){ + informer.setError("Nama penanggung jawab progress wajib diisi"); + cancel = true; + if(focusView == null){ + focusView = informer; + } + }else if(!JaservTechFilter.isNameValid(informerS)){ + informer.setError("hanya : (A-Z,a-z.0-9)"); + cancel = true; + if(focusView == null){ + focusView = informer; + } + }else if(JaservTechFilter.isContainMoreSpace(informerS)){ + informer.setError("mengandung double spasi"); + cancel = true; + if(focusView == null){ + focusView = informer; + } + } + + /* + // Check for a valid password, if the user entered one. + if (!TextUtils.isEmpty(nama) && !isPasswordValid(nama)) { + mPasswordView.setError(getString(R.string.error_invalid_password)); + focusView = mPasswordView; + cancel = true; + } + + // Check for a valid email address. + if (TextUtils.isEmpty(email)) { + mEmailView.setError(getString(R.string.error_field_required)); + focusView = mEmailView; + cancel = true; + } else if (!isEmailValid(email)) { + mEmailView.setError(getString(R.string.error_invalid_email)); + focusView = mEmailView; + cancel = true; + } + */ + if (cancel) { + focusView.requestFocus(); + // There was an error; don't attempt login and focus the first + // form field with an error. + } else { + // Show a progress spinner, and kick off a background task to + // perform the user login attempt. + try{ + showProgress(true); + Thread.sleep(3000); + }catch (InterruptedException e){ + + } + Date h = new Date(); + SimpleDateFormat jj = new SimpleDateFormat("yyyy.MM.dd"); + Progress s = new Progress(); + s.setId(jj.format(h) + "" + informerS.charAt(0) + "" + alamatS.charAt(2) + "" + namaS.charAt(5)); + s.setName(namaS); + s.setAddress(alamatS); + s.setAuth(informerS); + s.setCat(1); + s.setPercentage(0); + s.setFinish(0); + s.setStartDate(jj.format(h)); + s.setEndDate(""); + DBHandler hjk = new DBHandler(CreateProgressDefault.this); + if(hjk.addProgress(s)){ + try{ + Toast.makeText(CreateProgressDefault.this, "Data berhasil dimasukan", Toast.LENGTH_SHORT); + Thread.sleep(3000); + }catch(InterruptedException e){ + + }finally { + finish(); + } + } + // mAuthTask = new UserLoginTask(email, password); + // mAuthTask.execute((Void) null); + } + } + + /* + private boolean isEmailValid(String email) { + TODO: Replace this with your own logic + return email.contains("@"); + } + + private boolean isPasswordValid(String password) { + TODO: Replace this with your own logic + return password.length() > 4; + } + + /** + * Shows the progress UI and hides the login form. + */ + @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2) + private void showProgress(final boolean show) { + // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow + // for very easy animations. If available, use these APIs to fade-in + // the progress spinner. + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) { + int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime); + + mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE); + mLoginFormView.animate().setDuration(shortAnimTime).alpha( + show ? 0 : 1).setListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE); + } + }); + + mProgressView.setVisibility(show ? View.VISIBLE : View.GONE); + mProgressView.animate().setDuration(shortAnimTime).alpha( + show ? 1 : 0).setListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + mProgressView.setVisibility(show ? View.VISIBLE : View.GONE); + } + }); + } else { + // The ViewPropertyAnimator APIs are not available, so simply show + // and hide the relevant UI components. + mProgressView.setVisibility(show ? View.VISIBLE : View.GONE); + mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE); + } + } +} diff --git a/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/CreateProgressNext.java b/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/CreateProgressNext.java new file mode 100644 index 0000000..301b0f1 --- /dev/null +++ b/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/CreateProgressNext.java @@ -0,0 +1,285 @@ +package com.jafar.jaservtech.system3pjagung; + +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; +import android.annotation.TargetApi; +import android.os.Build; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.view.MenuItem; +import android.view.View; +import android.view.View.OnClickListener; +import android.widget.AutoCompleteTextView; +import android.widget.Button; +import android.widget.DatePicker; +import android.widget.EditText; +import android.widget.RelativeLayout; +import android.widget.Toast; + +import com.jafar.jaservtech.system3pjagung.dummy.DBHandler; +import com.jafar.jaservtech.system3pjagung.dummy.JaservTechFilter; +import com.jafar.jaservtech.system3pjagung.dummy.Progress; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * A login screen that offers login via email/password. + */ +public class CreateProgressNext extends AppCompatActivity { + + + // UI references. + private AutoCompleteTextView mEmailView; + private EditText mPasswordView,startProg; + private EditText nama, alamat,informer; + RelativeLayout showCalendar; + private View mProgressView; + private View mLoginFormView; + private DatePicker datePick; + private Button dateTimePick,input; + private void initializing(){ + this.mProgressView = (View)findViewById(R.id.login_progress); + this.mLoginFormView = (View)findViewById(R.id.login_form); + this.input = (Button)findViewById(R.id.email_sign_in_button); + this.input.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + attemptLogin(); + } + }); + this.datePick = (DatePicker)findViewById(R.id.datePicker); + this.datePick.setSpinnersShown(true); + this.datePick.setCalendarViewShown(false); + this.dateTimePick = (Button)findViewById(R.id.pilihDateTimePicker); + this.dateTimePick.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + Date temp = new Date(); + SimpleDateFormat hY = new SimpleDateFormat("yyyy"); + SimpleDateFormat hM = new SimpleDateFormat("MM"); + SimpleDateFormat hD = new SimpleDateFormat("dd"); + int Y = Integer.parseInt(hY.format(temp)); + int m = Integer.parseInt(hM.format(temp)); + int d = Integer.parseInt(hD.format(temp)); + int error = 0; + int Ys = datePick.getYear(); + int ms = datePick.getMonth()+1; + int ds = datePick.getDayOfMonth(); + if(Ys > Y){ + error++; + }else if(Ys == Y){ + if(ms > m){ + error++; + }else if(ms == m){ + if(ds > d) + error++; + else if(ds == d){ + error++; + } + } + } + if(error > 0){ + Toast.makeText(CreateProgressNext.this,"Tanggal anda tidak sesuai dengan kriteria masa lampau",Toast.LENGTH_LONG).show(); + }else{ + startProg.setText(Ys+"-"+ms+"-"+ds); + Toast.makeText(CreateProgressNext.this,"Tanggal berhasil dimasukan",Toast.LENGTH_LONG).show(); + showCalendar.animate().alpha(0).setDuration(600).setListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + super.onAnimationEnd(animation); + showCalendar.setVisibility(View.GONE); + } + }); + } + } + }); + startProg = (EditText)findViewById(R.id.startProgress); + showCalendar = (RelativeLayout)findViewById(R.id.showCalendar); + startProg.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + showCalendar.setVisibility(View.VISIBLE); + showCalendar.animate().alpha(1f).setDuration(600).setListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + super.onAnimationEnd(animation); + showCalendar.setVisibility(View.VISIBLE); + } + }); + } + }); + nama = (EditText)findViewById(R.id.namaProgress); + alamat = (EditText)findViewById(R.id.alamatProgress); + informer = (EditText)findViewById(R.id.informerProgress); + } + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_create_progress_next); + initializing(); + } + + /** + * Callback received when a permissions request has been completed. + */ + + /** + * Attempts to sign in or register the account specified by the login form. + * If there are form errors (invalid email, missing fields, etc.), the + * errors are presented and no actual login attempt is made. + */ + private void attemptLogin() { + + boolean cancel = false; + View focusView = null; + nama.setError(null); + alamat.setError(null); + informer.setError(null); + String namaS = nama.getText().toString(); + String alamatS = alamat.getText().toString(); + String informerS = informer.getText().toString(); + if(JaservTechFilter.isEmpty(namaS)){ + nama.setError("Nama progress Wajib diisi"); + cancel = true; + focusView = nama; + }else if(!JaservTechFilter.isNameFieldValid(namaS)){ + nama.setError("hanya : (A-Z a-z)"); + cancel = true; + focusView = nama; + }else if(JaservTechFilter.isContainMoreSpace(namaS)){ + nama.setError("mengandung double spasi"); + focusView = nama; + cancel = true; + } + if(JaservTechFilter.isEmpty(alamatS)){ + alamat.setError("Lokasi Ladang wajib diisi"); + cancel = true; + if(focusView == null){ + focusView = alamat; + } + }else if(!JaservTechFilter.isAddressValid(alamatS)){ + alamat.setError("hanya : (A-Z,a-z.0-9)"); + cancel = true; + if(focusView == null){ + focusView = alamat; + } + }else if(JaservTechFilter.isContainMoreSpace(alamatS)){ + alamat.setError("mengandung double spasi"); + cancel = true; + if(focusView == null){ + focusView = alamat; + } + } + + if(JaservTechFilter.isEmpty(informerS)){ + informer.setError("Nama penanggung jawab progress wajib diisi"); + cancel = true; + if(focusView == null){ + focusView = informer; + } + }else if(!JaservTechFilter.isNameValid(informerS)){ + informer.setError("hanya : (A-Z,a-z.0-9)"); + cancel = true; + if(focusView == null){ + focusView = informer; + } + }else if(JaservTechFilter.isContainMoreSpace(informerS)){ + informer.setError("mengandung double spasi"); + cancel = true; + if(focusView == null){ + focusView = informer; + } + } + startProg.setError(null); + String startProgS = startProg.getText().toString(); + if(JaservTechFilter.isEmpty(startProgS)){ + startProg.setError("Tanggal start belum dimasukan"); + cancel = true; + if (focusView == null){} + } + + if (cancel) { + // There was an error; don't attempt login and focus the first + // form field with an error. + focusView.requestFocus(); + } else { + try{ + showProgress(true); + Thread.sleep(3000); + }catch (InterruptedException e){ + + } + Date h = new Date(); + SimpleDateFormat jj = new SimpleDateFormat("yyyy.MM.dd"); + Progress s = new Progress(); + s.setId(jj.format(h) + "" + informerS.charAt(0) + "" + alamatS.charAt(2) + "" + namaS.charAt(5)); + s.setName(namaS); + s.setAddress(alamatS); + s.setAuth(informerS); + s.setCat(2); + s.setPercentage(0); + s.setFinish(0); + s.setStartDate(startProgS); + s.setEndDate(""); + DBHandler hjk = new DBHandler(CreateProgressNext.this); + if(hjk.addProgress(s)){ + try{ + Toast.makeText(CreateProgressNext.this, "Data berhasil dimasukan", Toast.LENGTH_SHORT); + Thread.sleep(3000); + }catch(InterruptedException e){ + + }finally { + finish(); + } + } + + } + } + /** + * Shows the progress UI and hides the login form. + */ + @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2) + private void showProgress(final boolean show) { + // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow + // for very easy animations. If available, use these APIs to fade-in + // the progress spinner. + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) { + int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime); + + mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE); + mLoginFormView.animate().setDuration(shortAnimTime).alpha( + show ? 0 : 1).setListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE); + } + }); + + mProgressView.setVisibility(show ? View.VISIBLE : View.GONE); + mProgressView.animate().setDuration(shortAnimTime).alpha( + show ? 1 : 0).setListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + mProgressView.setVisibility(show ? View.VISIBLE : View.GONE); + } + }); + } else { + // The ViewPropertyAnimator APIs are not available, so simply show + // and hide the relevant UI components. + mProgressView.setVisibility(show ? View.VISIBLE : View.GONE); + mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE); + } + } + + @Override + public boolean onOptionsItemSelected(MenuItem item){ + switch(item.getItemId()){ + case android.R.id.home : + finish(); + return true; + } + return super.onOptionsItemSelected(item); + } +} + diff --git a/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/HomeOfSystem.java b/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/HomeOfSystem.java new file mode 100644 index 0000000..7afb00c --- /dev/null +++ b/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/HomeOfSystem.java @@ -0,0 +1,243 @@ +package com.jafar.jaservtech.system3pjagung; + +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; +import android.content.Intent; +import android.os.Bundle; +import android.support.design.widget.FloatingActionButton; +import android.support.design.widget.NavigationView; +import android.support.v4.view.GravityCompat; +import android.support.v4.widget.DrawerLayout; +import android.support.v7.app.ActionBarDrawerToggle; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.view.LayoutInflater; +import android.view.MenuItem; +import android.view.View; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; + +import com.jafar.jaservtech.system3pjagung.dummy.DBHandler; + +public class HomeOfSystem extends AppCompatActivity + implements NavigationView.OnNavigationItemSelectedListener { + protected RelativeLayout home,progress,history,help,addProg; + protected FloatingActionButton fab; + protected ImageView createNew, createNext, backCreate; + protected Button h,ll; + protected LinearLayout j; + protected LinearLayout viewProg; + protected DBHandler db; + protected void initial(){ + viewProg = (LinearLayout)findViewById(R.id.viewerProgress); + home = (RelativeLayout)findViewById(R.id.home_layout); + progress = (RelativeLayout)findViewById(R.id.progress_layout); + history = (RelativeLayout)findViewById(R.id.history_layout); + help = (RelativeLayout)findViewById(R.id.help_layout); + db = new DBHandler(HomeOfSystem.this); + //h = (Button)findViewById(R.id.getLayout); + //ll = (Button)findViewById(R.id.getGoneLayout); + //j = (LinearLayout)findViewById(R.id.contentLayout); + createNew = (ImageView)findViewById(R.id.newProgress); + createNext = (ImageView)findViewById(R.id.nextProgress); + createNew.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + startActivity(new Intent(HomeOfSystem.this, CreateProgressDefault.class)); + addProgHide(); + fab.show(); + } + }); + createNext.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + startActivity(new Intent(HomeOfSystem.this, CreateProgressNext.class)); + addProgHide(); + fab.show(); + } + }); + backCreate = (ImageView)findViewById(R.id.outProgress); + addProg = (RelativeLayout)findViewById(R.id.optionCreateProgress); + backCreate.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + addProgHide(); + fab.show(); + } + }); + LayoutInflater inflater = (LayoutInflater)this.getSystemService(LAYOUT_INFLATER_SERVICE); + View jojo, kokos; + LinearLayout kokol; + for(int z = 0;z < 10;z++ ){ + final int kei = z; + jojo = inflater.inflate(R.layout.button_show_list,null); + jojo.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Toast.makeText(HomeOfSystem.this,"show : "+ kei,Toast.LENGTH_LONG).show(); + } + }); + kokos = inflater.inflate(R.layout.button_delete_list,null); + kokos.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + viewProg.removeViewAt(kei); + Toast.makeText(HomeOfSystem.this, "delete : " + kei, Toast.LENGTH_LONG).show(); + } + }); + kokol = (LinearLayout)inflater.inflate(R.layout.content_view_list,null); + kokol.addView(jojo); + kokol.addView(kokos); + kokol.setMinimumWidth(100); + viewProg.addView(kokol); + } + } + protected void showLayout(RelativeLayout temp){ + home.setVisibility(View.GONE); + progress.setVisibility(View.GONE); + history.setVisibility(View.GONE); + help.setVisibility(View.GONE); + temp.setVisibility(View.VISIBLE); + } + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_home_of_system); + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + + fab = (FloatingActionButton) findViewById(R.id.fab); + fab.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + fab.hide(); + addProgShow(); + } + }); + fab.hide(); + DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); + ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( + this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); + drawer.setDrawerListener(toggle); + toggle.syncState(); + + NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); + navigationView.setNavigationItemSelectedListener(this); + initial(); + refreshHistoryFastInfo(); + refreshProgresFastInfo(); + ImageView a,b; + a=(ImageView)findViewById(R.id.refreshHistoryFastInfo); + b=(ImageView)findViewById(R.id.refreshProgressFastInfo); + a.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + refreshHistoryFastInfo(); + } + }); + b.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + refreshProgresFastInfo(); + } + }); + Toast.makeText(HomeOfSystem.this,"Tap Image to refresh info fast from progress and history", Toast.LENGTH_LONG).show(); + } + protected void refreshProgresFastInfo(){ + int hkh = db.getProgresssHisCount(0); + TextView ko = (TextView)findViewById(R.id.progressTotal); + ko.setText("" + hkh + ""); + } + protected void refreshHistoryFastInfo(){ + int hkj = db.getProgresssHisCount(1); + TextView jo = (TextView)findViewById(R.id.historyTotal); + jo.setText("" + hkj + ""); + } + public void addProgShow(){ + addProg.setVisibility(View.VISIBLE); + addProg.animate().alpha(1.0f).setDuration(300).setListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + super.onAnimationEnd(animation); + addProg.setVisibility(View.VISIBLE); + } + }); + } + public void addProgHide(){ + addProg.animate().alpha(0.0f).setDuration(300).setListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + super.onAnimationEnd(animation); + addProg.setVisibility(View.GONE); + } + }); + } + + + @Override + public void onBackPressed() { + DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); + if (drawer.isDrawerOpen(GravityCompat.START)) { + drawer.closeDrawer(GravityCompat.START); + } else { + super.onBackPressed(); + } + } +/* +* + @Override + public boolean onCreateOptionsMenu(Menu menu) { + // Inflate the menu; this adds items to the action bar if it is present. + getMenuInflater().inflate(R.menu.home_of_system, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + // Handle action bar item clicks here. The action bar will + // automatically handle clicks on the Home/Up button, so long + // as you specify a parent activity in AndroidManifest.xml. + int id = item.getItemId(); + + //noinspection SimplifiableIfStatement + if (id == R.id.action_settings) { + return true; + } + + return super.onOptionsItemSelected(item); + } +* */ + + @SuppressWarnings("StatementWithEmptyBody") + @Override + public boolean onNavigationItemSelected(MenuItem item) { + // Handle navigation view item clicks here. + int id = item.getItemId(); + + if (id == R.id.home) { + showLayout(home); + fab.hide(); + Toast.makeText(HomeOfSystem.this,"Tap Image to refresh info fast from progress and history", Toast.LENGTH_LONG).show(); + } else if (id == R.id.history) { + showLayout(history); + fab.hide(); + } else if (id == R.id.progress) { + showLayout(progress); + fab.show(); + } else if (id == R.id.help) { + showLayout(help); + fab.hide(); + } + + DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); + drawer.closeDrawer(GravityCompat.START); + return true; + } + protected void homeSession(){ + + } +} diff --git a/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/dummy/DBHandler.java b/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/dummy/DBHandler.java new file mode 100644 index 0000000..ffacddf --- /dev/null +++ b/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/dummy/DBHandler.java @@ -0,0 +1,206 @@ +package com.jafar.jaservtech.system3pjagung.dummy; + + +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; +import java.util.List; +/** + * Created by Jafar on 4/5/2016. + */ +public class DBHandler extends SQLiteOpenHelper{ + + // Database Version + private static final int DATABASE_VERSION = 1; + + // Database Name + private static final String DATABASE_NAME = "System_third_p"; + + // Contacts table name + private static final String TABLE_ProgressS = "sc_prog"; + private static final String TABLE_ProgressS2 = "sc_detail_prog"; + + // Progresss Table Columns names + private static final String KEY_ID = "p_id"; + private static final String KEY_NAME = "p_name"; + private static final String KEY_SH_ADDR = "p_address"; + private static final String KEY_SH_SDATE = "p_start_date"; + private static final String KEY_SH_EDATE = "p_end_date"; + private static final String KEY_SH_AUT = "p_auth"; + private static final String KEY_SH_FIN = "p_finish"; + private static final String KEY_SH_CAT = "p_cat"; + private static final String KEY_SH_PERC = "p_percent"; + + public DBHandler(Context context) { + super(context, DATABASE_NAME, null, DATABASE_VERSION); + } + + @Override + public void onCreate(SQLiteDatabase db) { + String CREATE_CONTACTS_TABLE = "CREATE TABLE " + TABLE_ProgressS + "(" + + KEY_ID + " TEXT PRIMARY KEY," + + KEY_NAME + " TEXT," + + KEY_SH_ADDR + " TEXT," + + KEY_SH_SDATE + " TEXT," + + KEY_SH_EDATE + " TEXT," + + KEY_SH_AUT + " TEXT," + + KEY_SH_FIN + " INTEGER," + + KEY_SH_CAT + " INTEGER," + + KEY_SH_PERC + " INTEGER" + + ")"; + db.execSQL(CREATE_CONTACTS_TABLE); + } + + @Override + public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { + // Drop older table if existed + db.execSQL("DROP TABLE IF EXISTS " + TABLE_ProgressS); + // Creating tables again + onCreate(db); + } + //SESSION PROGRESS + // Adding new Progress okay + public boolean addProgress(Progress Progress) { + SQLiteDatabase db = this.getWritableDatabase(); + + ContentValues values = new ContentValues(); + values.put(KEY_ID, Progress.getId()); // Progress Phone Number + values.put(KEY_NAME, Progress.getName()); // Progress Name + values.put(KEY_SH_ADDR, Progress.getAddress()); // Progress Address of field + values.put(KEY_SH_SDATE, Progress.getStartDate()); // Progress Start farming + values.put(KEY_SH_EDATE, Progress.getEndDate()); // Progress End Farming + values.put(KEY_SH_AUT, Progress.getAuth()); // Progress Stake holder + values.put(KEY_SH_FIN, Progress.getFinish()); // Progress finish + values.put(KEY_SH_CAT, Progress.getCat()); // Category + values.put(KEY_SH_PERC, Progress.getPercentage()); // Progress percentage + // Inserting Row + db.insert(TABLE_ProgressS, null, values); + db.close(); // Closing database connection + return true; + } + + // Getting one Progress + public Progress getProgress(String id) { + SQLiteDatabase db = this.getReadableDatabase(); + + Cursor cursor = db.query(TABLE_ProgressS, new String[]{KEY_ID, + KEY_NAME, KEY_SH_ADDR}, KEY_ID + "=?", + new String[]{String.valueOf(id)}, null, null, null, null); + if (cursor == null) + return null; + cursor.moveToFirst(); + + Progress contact = new Progress(); + contact.setId(cursor.getString(0)); + contact.setName(cursor.getString(1)); + contact.setAddress(cursor.getString(2)); + contact.setStartDate(cursor.getString(3)); + contact.setEndDate(cursor.getString(4)); + contact.setAuth(cursor.getString(5)); + contact.setFinish(Integer.parseInt(cursor.getString(6))); + contact.setCat(Integer.parseInt(cursor.getString(7))); + contact.setPercentage(Integer.parseInt(cursor.getString(8))); + // return Progress + return contact; + } + + // Getting All Progresss + public List getAllProgresss() { + List ProgressList = new ArrayList(); + // Select All Query + String selectQuery = "SELECT * FROM " + TABLE_ProgressS; + + SQLiteDatabase db = this.getWritableDatabase(); + Cursor cursor = db.rawQuery(selectQuery, null); + + // looping through all rows and adding to list + if (cursor.moveToFirst()) { + do { + Progress contact = new Progress(); + contact.setId(cursor.getString(0)); + contact.setName(cursor.getString(1)); + contact.setAddress(cursor.getString(2)); + contact.setStartDate(cursor.getString(3)); + contact.setEndDate(cursor.getString(4)); + contact.setAuth(cursor.getString(5)); + contact.setFinish(Integer.parseInt(cursor.getString(6))); + contact.setCat(Integer.parseInt(cursor.getString(7))); + contact.setPercentage(Integer.parseInt(cursor.getString(8))); + // Adding contact to list + ProgressList.add(contact); + } while (cursor.moveToNext()); + } + + // return contact list + return ProgressList; + } + + public List getAllProgHistory() { + List ProgressList = new ArrayList(); + // Select All Query + String selectQuery = "SELECT * FROM " + TABLE_ProgressS+"WHERE "+KEY_SH_FIN+"=1"; + + SQLiteDatabase db = this.getWritableDatabase(); + Cursor cursor = db.rawQuery(selectQuery, null); + + // looping through all rows and adding to list + if (cursor.moveToFirst()) { + do { + Progress contact = new Progress(); + contact.setId(cursor.getString(0)); + contact.setName(cursor.getString(1)); + contact.setAddress(cursor.getString(2)); + contact.setStartDate(cursor.getString(3)); + contact.setEndDate(cursor.getString(4)); + contact.setAuth(cursor.getString(5)); + contact.setFinish(Integer.parseInt(cursor.getString(6))); + contact.setCat(Integer.parseInt(cursor.getString(7))); + contact.setPercentage(Integer.parseInt(cursor.getString(8))); + // Adding contact to list + ProgressList.add(contact); + } while (cursor.moveToNext()); + } + + // return contact list + return ProgressList; + } + // Getting ProgresssHistory Count + public int getProgresssHisCount(int t) { + String countQuery = "SELECT * FROM " + TABLE_ProgressS + " WHERE " + KEY_SH_FIN + "=" + t; + SQLiteDatabase db = this.getWritableDatabase(); + return db.rawQuery(countQuery, null).getCount(); + } + + // Updating a Progress + public int updateProgress(Progress Progress) { + SQLiteDatabase db = this.getWritableDatabase(); + + ContentValues values = new ContentValues(); + values.put(KEY_NAME, Progress.getName()); // Progress Name + values.put(KEY_SH_ADDR, Progress.getAddress()); // Progress Address of field + values.put(KEY_SH_SDATE, Progress.getStartDate()); // Progress Start farming + values.put(KEY_SH_EDATE, Progress.getEndDate()); // Progress End Farming + values.put(KEY_SH_AUT, Progress.getAuth()); // Progress Stake holder + values.put(KEY_SH_FIN, Progress.getFinish()); // Progress finish + values.put(KEY_SH_CAT, Progress.getCat()); // kategori + values.put(KEY_SH_PERC, Progress.getPercentage()); // Progress percentage + + // updating row + return db.update(TABLE_ProgressS, values, KEY_ID + " = ?", + new String[]{String.valueOf(Progress.getId())}); + } + + // Deleting a Progress + public void deleteProgress(Progress Progress) { + SQLiteDatabase db = this.getWritableDatabase(); + db.delete(TABLE_ProgressS, KEY_ID + " = ?", + new String[] { String.valueOf(Progress.getId()) }); + db.close(); + } +} + + diff --git a/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/dummy/DummyContent.java b/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/dummy/DummyContent.java new file mode 100644 index 0000000..053fa30 --- /dev/null +++ b/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/dummy/DummyContent.java @@ -0,0 +1,72 @@ +package com.jafar.jaservtech.system3pjagung.dummy; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Helper class for providing sample content for user interfaces created by + * Android template wizards. + *

+ * TODO: Replace all uses of this class before publishing your app. + */ +public class DummyContent { + + /** + * An array of sample (dummy) items. + */ + public static final List ITEMS = new ArrayList(); + + /** + * A map of sample (dummy) items, by ID. + */ + public static final Map ITEM_MAP = new HashMap(); + + private static final int COUNT = 25; + + static { + // Add some sample items. + for (int i = 1; i <= COUNT; i++) { + addItem(createDummyItem(i)); + } + } + + private static void addItem(DummyItem item) { + ITEMS.add(item); + ITEM_MAP.put(item.id, item); + } + + private static DummyItem createDummyItem(int position) { + return new DummyItem(String.valueOf(position), "Item " + position, makeDetails(position)); + } + + private static String makeDetails(int position) { + StringBuilder builder = new StringBuilder(); + builder.append("Details about Item: ").append(position); + for (int i = 0; i < position; i++) { + builder.append("\nMore details information here."); + } + return builder.toString(); + } + + /** + * A dummy item representing a piece of content. + */ + public static class DummyItem { + public final String id; + public final String content; + public final String details; + + public DummyItem(String id, String content, String details) { + this.id = id; + this.content = content; + this.details = details; + } + + @Override + public String toString() { + return content; + } + } +} diff --git a/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/dummy/JaservTechFilter.java b/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/dummy/JaservTechFilter.java new file mode 100644 index 0000000..6293af1 --- /dev/null +++ b/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/dummy/JaservTechFilter.java @@ -0,0 +1,100 @@ +package com.jafar.jaservtech.system3pjagung.dummy; + +/** + * Created by Jafar on 4/9/2016. + */ +public class JaservTechFilter { + public static boolean isEmpty(String nama){ + return (nama.length() ==0); + } + public static boolean isNameValid(String nama){ + int jk; + for(int i = 0; i 90){ + if(jk <97) + return false; + else if(jk > 122) + return false; + } + } + return true; + } + public static boolean isNameFieldValid(String nama){ + int jk; + for(int i = 0; i 57){ + return false; + } + }else if(jk > 90){ + if(jk <97) + return false; + else if(jk > 122) + return false; + } + } + return true; + } + public static boolean isAddressValid(String address){ + int jk; + for(int i = 0; i 57) { + return false; + } + }else if(jk > 90){ + if(jk <97) + return false; + else if(jk > 122) + return false; + } + } + return true; + } + public static boolean isContainMoreSpace(String nama){ + nama+=""; + int com,k; + int error=0; + for(int i=0;i0) + error++; + break; + } + } + if(k == nama.length()){ + if(com>0) + error++; + } + } + } + if(error > 0){ + return true; + }else{ + return false; + } + } +} diff --git a/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/dummy/Progress.java b/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/dummy/Progress.java new file mode 100644 index 0000000..0708128 --- /dev/null +++ b/System3PJagung/app/src/main/java/com/jafar/jaservtech/system3pjagung/dummy/Progress.java @@ -0,0 +1,83 @@ +package com.jafar.jaservtech.system3pjagung.dummy; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * Created by Jafar on 4/5/2016. + */ +public class Progress { + + private String id; //id progress + private String name; //nama progress + private String address; //lokasi progress + private int percentage; //persentase of progress + private String startDate; //tanggal mulai progress format dd-mm-yy hh-a-s + private String endDate; //tanggal mulai progress format dd-mm-yy hh-a-s + private int finish; //status progress telah selesai 0 sedang berjalan, 1 telah selesai + private int cat;//kategori dari awal atau melanjutkan + private String auth; //penanggung jawab progress + //private function + private void generateIdProgress(){ + Date h = new Date(); + SimpleDateFormat j = new SimpleDateFormat("yyyyMMddhhmm"); + this.id = j.format(h); + } + private void initializing(){ + this.generateIdProgress(); + this.finish = 0; + this.percentage = 0; + } + //constructor + public Progress() + { + this.initializing(); + } + public Progress(String nama,String add, int percen,String aut, String start){ + this.initializing(); + this.name = nama; + this.address = add; + this.percentage = percen; + this.auth = aut; + this.startDate = start; + } + //setter + public void setId(String id) { + this.id = id; + } + public void setName(String name) { + this.name = name; + } + public void setAddress(String address) { this.address = address; } + public void setPercentage(int percen){ this.percentage = percen;} + public void setStartDate(String start){this.startDate = start;} + public void setEndDate(String end){this.endDate = end;} + public void setFinish(int fins){ this.finish = fins;} + public void setAuth(String aut){ this.auth = aut;} + public void setCat(int s){this.cat = s;} + + //getter + public String getId() { return id; } + public String getAddress() { + return address; + } + public String getName() { + return name; + } + public int getPercentage(){ + return percentage; + } + public int getFinish(){ + return finish; + } + public String getStartDate(){ + return startDate; + } + public String getEndDate(){ + return endDate; + } + public String getAuth(){ + return auth; + } + public int getCat(){return cat;} +} \ No newline at end of file diff --git a/System3PJagung/app/src/main/res/drawable-v21/ic_menu_camera.xml b/System3PJagung/app/src/main/res/drawable-v21/ic_menu_camera.xml new file mode 100644 index 0000000..0d9ea10 --- /dev/null +++ b/System3PJagung/app/src/main/res/drawable-v21/ic_menu_camera.xml @@ -0,0 +1,12 @@ + + + + diff --git a/System3PJagung/app/src/main/res/drawable-v21/ic_menu_gallery.xml b/System3PJagung/app/src/main/res/drawable-v21/ic_menu_gallery.xml new file mode 100644 index 0000000..f6872c4 --- /dev/null +++ b/System3PJagung/app/src/main/res/drawable-v21/ic_menu_gallery.xml @@ -0,0 +1,9 @@ + + + diff --git a/System3PJagung/app/src/main/res/drawable-v21/ic_menu_manage.xml b/System3PJagung/app/src/main/res/drawable-v21/ic_menu_manage.xml new file mode 100644 index 0000000..c1be60b --- /dev/null +++ b/System3PJagung/app/src/main/res/drawable-v21/ic_menu_manage.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/System3PJagung/app/src/main/res/drawable-v21/ic_menu_send.xml b/System3PJagung/app/src/main/res/drawable-v21/ic_menu_send.xml new file mode 100644 index 0000000..00c668c --- /dev/null +++ b/System3PJagung/app/src/main/res/drawable-v21/ic_menu_send.xml @@ -0,0 +1,9 @@ + + + diff --git a/System3PJagung/app/src/main/res/drawable-v21/ic_menu_share.xml b/System3PJagung/app/src/main/res/drawable-v21/ic_menu_share.xml new file mode 100644 index 0000000..a28fb9e --- /dev/null +++ b/System3PJagung/app/src/main/res/drawable-v21/ic_menu_share.xml @@ -0,0 +1,9 @@ + + + diff --git a/System3PJagung/app/src/main/res/drawable-v21/ic_menu_slideshow.xml b/System3PJagung/app/src/main/res/drawable-v21/ic_menu_slideshow.xml new file mode 100644 index 0000000..209aa64 --- /dev/null +++ b/System3PJagung/app/src/main/res/drawable-v21/ic_menu_slideshow.xml @@ -0,0 +1,9 @@ + + + diff --git a/System3PJagung/app/src/main/res/drawable/back.png b/System3PJagung/app/src/main/res/drawable/back.png new file mode 100644 index 0000000..bc1e2d3 Binary files /dev/null and b/System3PJagung/app/src/main/res/drawable/back.png differ diff --git a/System3PJagung/app/src/main/res/drawable/corn.png b/System3PJagung/app/src/main/res/drawable/corn.png new file mode 100644 index 0000000..c916a33 Binary files /dev/null and b/System3PJagung/app/src/main/res/drawable/corn.png differ diff --git a/System3PJagung/app/src/main/res/drawable/cpnew.png b/System3PJagung/app/src/main/res/drawable/cpnew.png new file mode 100644 index 0000000..bf28ccc Binary files /dev/null and b/System3PJagung/app/src/main/res/drawable/cpnew.png differ diff --git a/System3PJagung/app/src/main/res/drawable/cpnext.png b/System3PJagung/app/src/main/res/drawable/cpnext.png new file mode 100644 index 0000000..92e20e3 Binary files /dev/null and b/System3PJagung/app/src/main/res/drawable/cpnext.png differ diff --git a/System3PJagung/app/src/main/res/drawable/help.png b/System3PJagung/app/src/main/res/drawable/help.png new file mode 100644 index 0000000..89ef782 Binary files /dev/null and b/System3PJagung/app/src/main/res/drawable/help.png differ diff --git a/System3PJagung/app/src/main/res/drawable/help_ico.png b/System3PJagung/app/src/main/res/drawable/help_ico.png new file mode 100644 index 0000000..df5b394 Binary files /dev/null and b/System3PJagung/app/src/main/res/drawable/help_ico.png differ diff --git a/System3PJagung/app/src/main/res/drawable/history.png b/System3PJagung/app/src/main/res/drawable/history.png new file mode 100644 index 0000000..fa95100 Binary files /dev/null and b/System3PJagung/app/src/main/res/drawable/history.png differ diff --git a/System3PJagung/app/src/main/res/drawable/progress.png b/System3PJagung/app/src/main/res/drawable/progress.png new file mode 100644 index 0000000..bc3af18 Binary files /dev/null and b/System3PJagung/app/src/main/res/drawable/progress.png differ diff --git a/System3PJagung/app/src/main/res/drawable/side_nav_bar.xml b/System3PJagung/app/src/main/res/drawable/side_nav_bar.xml new file mode 100644 index 0000000..458b4b0 --- /dev/null +++ b/System3PJagung/app/src/main/res/drawable/side_nav_bar.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/System3PJagung/app/src/main/res/layout/acc_content.xml b/System3PJagung/app/src/main/res/layout/acc_content.xml new file mode 100644 index 0000000..cebd9aa --- /dev/null +++ b/System3PJagung/app/src/main/res/layout/acc_content.xml @@ -0,0 +1,11 @@ + + + + \ No newline at end of file diff --git a/System3PJagung/app/src/main/res/layout/activity_checking_component_user.xml b/System3PJagung/app/src/main/res/layout/activity_checking_component_user.xml new file mode 100644 index 0000000..cb91def --- /dev/null +++ b/System3PJagung/app/src/main/res/layout/activity_checking_component_user.xml @@ -0,0 +1,38 @@ + + + + + + + + + + \ No newline at end of file diff --git a/System3PJagung/app/src/main/res/layout/activity_create_progress_default.xml b/System3PJagung/app/src/main/res/layout/activity_create_progress_default.xml new file mode 100644 index 0000000..a9a3c34 --- /dev/null +++ b/System3PJagung/app/src/main/res/layout/activity_create_progress_default.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + +