add project adins

This commit is contained in:
Alfrid Sanjaya Leo Putra 2024-07-25 14:44:22 +07:00
commit f8f85d679d
5299 changed files with 625430 additions and 0 deletions

View file

@ -0,0 +1,360 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<import type="com.adins.mss.foundation.formatter.Formatter"
alias="fmt" />
<import type="com.adins.mss.constant.Global"
alias="const" />
<variable
name="is_processed"
type="String" />
<variable
name="status"
type="String" />
<variable
name="surveyHeader"
type="com.adins.mss.base.dynamicform.SurveyHeaderBean" />
</data>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg_grayscale"
android:orientation="vertical"
android:visibility="visible" >
<View
android:id="@+id/actionbar"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/actionbar_background" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/buttons"
android:layout_below="@+id/actionbar" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:padding="5dp"
android:visibility="visible" >
<LinearLayout
android:id="@+id/layoutTaskId"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:visibility="gone" >
<TextView
android:id="@+id/lblTaskId"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/customer_task_id"
android:textColor="@color/tv_darker" >
</TextView>
<EditText
android:id="@+id/txtTaskId"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxLength="60"
android:paddingLeft="5dp"
android:textColor="@color/tv_darker"
android:textColorHint="@color/tv_gray" >
</EditText>
</LinearLayout>
<TextView
android:id="@+id/lblCustomerName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/customer_name"
android:textColor="@color/tv_darker" >
</TextView>
<EditText
android:id="@+id/txtCustomerName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/customer_name"
android:text=""
android:maxLength="60"
android:paddingLeft="5dp"
android:singleLine="true"
android:textColor="@color/tv_darker"
android:textColorHint="@color/tv_gray" >
<requestFocus />
</EditText>
<TextView
android:id="@+id/lblCustomerPhone"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:text="@string/customer_phone_number"
android:textColor="@color/tv_darker" />
<EditText
android:id="@+id/txtCustomerPhone"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/customer_phone_number"
android:text=""
android:inputType="number"
android:maxLength="20"
android:paddingLeft="5dp"
android:textColor="@color/tv_darker"
android:textColorHint="@color/tv_gray" >
</EditText>
<TextView
android:id="@+id/lblCustomerAddress"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:text="@string/customer_address"
android:textColor="@color/tv_darker" />
<EditText
android:id="@+id/txtCustomerAddress"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:gravity="top|left"
android:hint="@string/customer_address"
android:text=""
android:maxLength="120"
android:minLines="2"
android:paddingLeft="5dp"
android:textColor="@color/tv_darker"
android:textColorHint="@color/tv_gray" >
</EditText>
<TextView
android:id="@+id/lblZipCode"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:text="@string/customer_zip_code"
android:textColor="@color/tv_darker"
android:visibility="gone" />
<EditText
android:id="@+id/txtZipCode"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/customer_zip_code"
android:text=""
android:inputType="number"
android:maxLength="20"
android:paddingLeft="5dp"
android:textColor="@color/tv_darker"
android:textColorHint="@color/tv_gray"
android:visibility="gone" >
</EditText>
<TextView
android:id="@+id/txtSurveyLocationTitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:maxLength="500"
android:text="@string/survey_location"
android:textColor="@color/tv_darker"
>
</TextView>
<EditText
android:id="@+id/txtSurveyLocation"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="top|left"
android:hint="@string/survey_location_hint"
android:minLines="3"
android:paddingLeft="5dp"
android:textColor="@color/tv_darker"
android:textColorHint="@color/tv_gray" >
</EditText>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:maxLength="500"
android:text="@string/customer_notes"
android:textColor="@color/tv_darker" >
</TextView>
<EditText
android:id="@+id/txtNotes"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="top|left"
android:hint="@string/customer_notes_hint"
android:text=""
android:minLines="3"
android:paddingLeft="5dp"
android:textColor="@color/tv_darker"
android:textColorHint="@color/tv_gray" >
</EditText>
<TextView
android:id="@+id/txtVoiceNote"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:maxLength="500"
android:text="@string/voice_notes"
android:textColor="@color/tv_darker" >
</TextView>
<ToggleButton
android:id="@+id/btnVoiceNotes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@android:color/transparent"
android:drawableTop="@drawable/ic_voice_note"
android:textColor="@color/tv_darker"
android:textOff="@string/voice_notes_record"
android:textOn="@string/voice_notes_stop"
android:visibility="gone" />
<TextView
android:id="@+id/txtNoVoiceNote"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:gravity="center_horizontal"
android:maxLength="500"
android:shadowColor="@color/tv_darker"
android:text="@string/voice_notes_not_available"
android:textColor="#555555"
android:visibility="gone" >
</TextView>
<TextView
android:id="@+id/lblPtsDate"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="7dp"
android:text="@string/ptsDate"
android:textColor="@color/tv_darker"
android:visibility="gone" />
<EditText
android:id="@+id/txtPtsDate"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/ptsDate"
android:text=""
android:inputType="datetime"
android:maxLength="30"
android:enabled="false"
android:paddingLeft="5dp"
android:textColor="@color/tv_darker"
android:textColorHint="@color/tv_gray"
android:visibility="gone" >
</EditText>
<LinearLayout
android:id="@+id/recorderLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/gradient_end"
android:gravity="center"
android:orientation="horizontal"
android:padding="5dp"
android:textOn="Stop"
android:visibility="gone" >
<ImageButton
android:id="@+id/btnPlay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/circle_button"
android:src="@drawable/ic_play" />
<ImageButton
android:id="@+id/btnStop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:background="@drawable/circle_button"
android:src="@drawable/ic_stop" />
</LinearLayout>
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/buttons"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="right"
android:padding="5dp" >
<Button
android:id="@+id/btnPts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="@string/btnReschedule"
android:textAppearance="?android:attr/textAppearanceSmall"
android:visibility="gone" >
</Button>
<Button
android:id="@+id/btnReset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/button_background"
android:text="@string/btnReset"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#ffffff" >
</Button>
<Button
android:id="@+id/btnStartSurvey"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/button_background"
android:text="@string/btnStart"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#ffffff" >
</Button>
<Button
android:id="@+id/btnViewTask"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/btnView"
android:textAppearance="?android:attr/textAppearanceSmall"
android:visibility="gone" >
</Button>
<Button
android:id="@+id/btnPrint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/btnPrint"
android:textAppearance="?android:attr/textAppearanceSmall"
android:visibility="gone" >
</Button>
</LinearLayout>
</RelativeLayout>
</layout>

View file

@ -0,0 +1,19 @@
package com.adins.mss.foundation.camera;
import android.hardware.Camera;
import android.hardware.Camera.Face;
import com.adins.mss.foundation.camerainapp.helper.Logger;
public class FaceDetectionListener implements android.hardware.Camera.FaceDetectionListener {
@Override
public void onFaceDetection(Face[] faces, Camera camera) {
// TODO Auto-generated method stub
if (faces.length > 0) {
Logger.d("FaceDetection", "face detected: " + faces.length +
" Face 1 Location X: " + faces[0].rect.centerX() +
"Y: " + faces[0].rect.centerY());
}
}
}

View file

@ -0,0 +1,94 @@
package com.adins.mss.foundation.security;
import org.bouncycastle.crypto.digests.SHA1Digest;
import org.bouncycastle.crypto.params.KeyParameter;
import org.bouncycastle.crypto.params.ParametersWithIV;
import org.bouncycastle.util.encoders.Base64Encoder;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.security.SecureRandom;
public class SHA1KeyGenerator {
SecureRandom sr = new SecureRandom();
public SHA1KeyGenerator() {
super();
}
public byte[] generateSHA1(byte[] ClearText) {
SHA1Digest dSHA1 = new SHA1Digest();
byte[] outSHA1 = new byte[dSHA1.getDigestSize()];
dSHA1.update(ClearText, 0, ClearText.length);
dSHA1.doFinal(outSHA1, 0);
return outSHA1;
}
public ParametersWithIV generateKeyParameter() {
byte[] iv128 = new byte[128 / 8];
byte[] key128 = new byte[128 / 8];
sr.nextBytes(key128);
KeyParameter keyAES = new KeyParameter(key128);
sr.nextBytes(iv128);
ParametersWithIV paramsWithIV = new ParametersWithIV(keyAES, iv128);
return paramsWithIV;
}
public byte[] customSha1() {
String Messagestr = "admin";
String postfix = "Caesar";
byte[] Messagestrbyte = Messagestr.getBytes();
byte[] postfixbyte = postfix.getBytes();
SHA1Digest digest = new SHA1Digest();
digest.update(Messagestrbyte, 0, Messagestrbyte.length);
digest.update(postfixbyte, 0, postfixbyte.length);
byte[] hash = new byte[digest.getDigestSize()];
digest.doFinal(hash, 0);
return hash;
}
public byte[] customSha1Calculate(String received) {
int separation = received.indexOf('\n');
String receivedHash = received.substring(separation + 1);
String message = "";
if (separation == -1) {
message = received;
} else {
message = received.substring(0, separation);
}
byte[] messagebyte = message.getBytes();
String postfix = "Caesar";
byte[] postfixbyte = postfix.getBytes();
SHA1Digest digest = new SHA1Digest();
int plaintextLength = messagebyte.length - 20;
byte[] plaintext = new byte[plaintextLength];
byte[] hash = new byte[20];
System.arraycopy(messagebyte, 0, plaintext, 0, plaintextLength);
System.arraycopy(messagebyte, plaintextLength, hash, 0, 20);
SHA1Digest digest2 = new SHA1Digest();
digest2.update(plaintext, 0, plaintext.length);
byte[] hash2 = new byte[digest2.getDigestSize()];
digest2.doFinal(hash2, 0);
digest.update(messagebyte, 0, messagebyte.length);
digest.update(postfixbyte, 0, postfixbyte.length);
byte[] calculatedhash = new byte[digest.getDigestSize()];
digest.doFinal(calculatedhash, 0);
ByteArrayOutputStream output = new ByteArrayOutputStream();
Base64Encoder base64 = new Base64Encoder();
try {
base64.decode(receivedHash, output);
} catch (IOException e) {
e.printStackTrace();
}
byte[] receivedHashbyte = output.toByteArray();
return receivedHashbyte;
}
}

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding= "utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<translate android:fromXDelta="0%"
android:fromYDelta="0"
android:toXDelta="-750%"
android:toYDelta="0"
android:duration="100"
android:interpolator="@android:anim/anticipate_overshoot_interpolator" />
</set>

View file

@ -0,0 +1,39 @@
/*
* Copyright 2013 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.co.senab.actionbarpulltorefresh.library.viewdelegates;
import android.view.View;
/**
* ViewDelegates are what are used to de-couple the Attacher from the different types of
* scrollable views.
*/
public interface ViewDelegate {
/**
* Allows you to provide support for View which do not have built-in
* support. In this method you should cast <code>view</code> to it's
* native class, and check if it is scrolled to the top.
*
* @param view The view which has should be checked against.
* @param x The X co-ordinate of the touch event
* @param y The Y co-ordinate of the touch event
* @return true if <code>view</code> is scrolled to the top.
*/
public boolean isReadyForPull(View view, float x, float y);
}

View file

@ -0,0 +1,45 @@
package com.adins.mss.odr;
import android.content.Intent;
import android.os.Bundle;
import com.adins.mss.base.SynchronizeActivity;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.google.firebase.perf.FirebasePerformance;
import com.google.firebase.perf.metrics.Trace;
public class MOSynchronizeActivity extends SynchronizeActivity{
private Trace synchronizeOrdTrace;
private FirebaseAnalytics screenName;
@Override
protected Intent getIntentMainMenu() {
// TODO Auto-generated method stub
return new Intent(this, NewMOMainActivity.class);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
screenName = FirebaseAnalytics.getInstance(this);
synchronizeOrdTrace = FirebasePerformance.getInstance().newTrace(getString(R.string.synchronize_trace_order));
activity = this;
super.onCreate(savedInstanceState);
}
@Override
protected void onResume() {
//Set Firebase screen name
screenName.setCurrentScreen(this,getString(com.adins.mss.base.R.string.screen_name_odr_synchronize),null);
synchronizeOrdTrace.start();
super.onResume();
}
@Override
protected void onPause() {
synchronizeOrdTrace.stop();
super.onPause();
}
}

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

View file

@ -0,0 +1,27 @@
package com.adins.mss.base.syncfile;
import com.adins.mss.foundation.http.MssRequestType;
import java.io.Serializable;
import java.util.Date;
/**
* Created by loise on 10/16/2017.
*/
/**
* json request template for getting list of files to be downloaded from server
*/
public class SyncFileRequest extends MssRequestType implements Serializable {
private java.util.Date dtm_upd;
public Date getDtm_upd() {
return dtm_upd;
}
public void setDtm_upd(Date dtm_upd) {
this.dtm_upd = dtm_upd;
}
}

View file

@ -0,0 +1,8 @@
package com.adins.mss.foundation.sync.api;
/**
* Created by adityapurwa on 12/03/15.
*/
public interface SynchronizationMapper<T> {
public void map(String property, String value, T target);
}

View file

@ -0,0 +1,15 @@
package com.adins.mss.svy;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB