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