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,6 @@
#Thu Oct 08 11:16:30 ICT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

View file

@ -0,0 +1,246 @@
/*
* 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;
import android.app.Activity;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;
import com.adins.mss.base.R;
import com.adins.mss.foundation.camerainapp.helper.Logger;
import uk.co.senab.actionbarpulltorefresh.library.listeners.HeaderViewListener;
import uk.co.senab.actionbarpulltorefresh.library.viewdelegates.ViewDelegate;
/**
* The main component of the library. You wrap the views you wish to be 'pullable' within this layout.
* This layout is setup by using the {@link ActionBarPullToRefresh} setup-wizard return by
*
* @link ActionBarPullToRefresh#from(android.app.Activity)}.
*/
public class PullToRefreshLayout extends FrameLayout {
private static final boolean DEBUG = false;
private static final String LOG_TAG = "PullToRefreshLayout";
private PullToRefreshAttacher mPullToRefreshAttacher;
public PullToRefreshLayout(Context context) {
this(context, null);
}
public PullToRefreshLayout(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public PullToRefreshLayout(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
/**
* @return true if this Attacher is currently in a refreshing state.
*/
public final boolean isRefreshing() {
ensureAttacher();
return mPullToRefreshAttacher.isRefreshing();
}
/**
* Manually set this Attacher's refreshing state. The header will be
* displayed or hidden as requested.
*
* @param refreshing - Whether the attacher should be in a refreshing state,
*/
public final void setRefreshing(boolean refreshing) {
ensureAttacher();
mPullToRefreshAttacher.setRefreshing(refreshing);
}
/**
* Call this when your refresh is complete and this view should reset itself
* (header view will be hidden).
* <p>
* This is the equivalent of calling <code>setRefreshing(false)</code>.
*/
public final void setRefreshComplete() {
ensureAttacher();
mPullToRefreshAttacher.setRefreshComplete();
}
/**
* Set a {@link uk.co.senab.actionbarpulltorefresh.library.listeners.HeaderViewListener} which is called when the visibility
* state of the Header View has changed.
*
* @param listener
*/
public final void setHeaderViewListener(HeaderViewListener listener) {
ensureAttacher();
mPullToRefreshAttacher.setHeaderViewListener(listener);
}
/**
* @return The Header View which is displayed when the user is pulling, or
* we are refreshing.
*/
public final View getHeaderView() {
ensureAttacher();
return mPullToRefreshAttacher.getHeaderView();
}
/**
* @return The HeaderTransformer currently used by this Attacher.
*/
public HeaderTransformer getHeaderTransformer() {
ensureAttacher();
return mPullToRefreshAttacher.getHeaderTransformer();
}
@Override
public final boolean onInterceptTouchEvent(MotionEvent event) {
if (DEBUG) {
Logger.d(LOG_TAG, "onInterceptTouchEvent. " + event.toString());
}
if (isEnabled() && mPullToRefreshAttacher != null && getChildCount() > 0) {
return mPullToRefreshAttacher.onInterceptTouchEvent(event);
}
return false;
}
@Override
public final boolean onTouchEvent(MotionEvent event) {
if (DEBUG) {
Logger.d(LOG_TAG, "onTouchEvent. " + event.toString());
}
if (isEnabled() && mPullToRefreshAttacher != null) {
return mPullToRefreshAttacher.onTouchEvent(event);
}
return super.onTouchEvent(event);
}
@Override
public FrameLayout.LayoutParams generateLayoutParams(AttributeSet attrs) {
return new PullToRefreshLayout.LayoutParams(getContext(), attrs);
}
@Override
protected void onDetachedFromWindow() {
// Destroy the PullToRefreshAttacher
if (mPullToRefreshAttacher != null) {
mPullToRefreshAttacher.destroy();
}
super.onDetachedFromWindow();
}
@Override
protected void onConfigurationChanged(Configuration newConfig) {
if (mPullToRefreshAttacher != null) {
mPullToRefreshAttacher.onConfigurationChanged(newConfig);
}
super.onConfigurationChanged(newConfig);
}
void setPullToRefreshAttacher(PullToRefreshAttacher attacher) {
if (mPullToRefreshAttacher != null) {
mPullToRefreshAttacher.destroy();
}
mPullToRefreshAttacher = attacher;
}
void addAllChildrenAsPullable() {
ensureAttacher();
for (int i = 0, z = getChildCount(); i < z; i++) {
addRefreshableView(getChildAt(i));
}
}
void addChildrenAsPullable(int[] viewIds) {
for (int i = 0, z = viewIds.length; i < z; i++) {
View view = findViewById(viewIds[i]);
if (view != null) {
addRefreshableView(findViewById(viewIds[i]));
}
}
}
void addChildrenAsPullable(View[] views) {
for (int i = 0, z = views.length; i < z; i++) {
if (views[i] != null) {
addRefreshableView(views[i]);
}
}
}
void addRefreshableView(View view) {
if (mPullToRefreshAttacher != null) {
mPullToRefreshAttacher.addRefreshableView(view, getViewDelegateFromLayoutParams(view));
}
}
ViewDelegate getViewDelegateFromLayoutParams(View view) {
if (view != null && view.getLayoutParams() instanceof LayoutParams) {
LayoutParams lp = (LayoutParams) view.getLayoutParams();
String clazzName = lp.getViewDelegateClassName();
if (!TextUtils.isEmpty(clazzName)) {
// Lets convert any relative class names (i.e. .XYZViewDelegate)
final int firstDot = clazzName.indexOf('.');
if (firstDot == -1) {
clazzName = getContext().getPackageName() + "." + clazzName;
} else if (firstDot == 0) {
clazzName = getContext().getPackageName() + clazzName;
}
return InstanceCreationUtils.instantiateViewDelegate(getContext(), clazzName);
}
}
return null;
}
protected PullToRefreshAttacher createPullToRefreshAttacher(Activity activity,
Options options) {
return new PullToRefreshAttacher(activity, options != null ? options : new Options());
}
private void ensureAttacher() {
if (mPullToRefreshAttacher == null) {
throw new IllegalStateException("You need to setup the PullToRefreshLayout before using it");
}
}
static class LayoutParams extends FrameLayout.LayoutParams {
private final String mViewDelegateClassName;
LayoutParams(Context c, AttributeSet attrs) {
super(c, attrs);
TypedArray a = c.obtainStyledAttributes(attrs, R.styleable.PullToRefreshView);
mViewDelegateClassName = a
.getString(R.styleable.PullToRefreshView_ptrViewDelegateClass);
a.recycle();
}
String getViewDelegateClassName() {
return mViewDelegateClassName;
}
}
}

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@android:color/transparent" />
<stroke
android:width="1dp"
android:color="@android:color/black" /> <!-- Border width and color -->
<corners android:radius="0dp" /><!-- Border corner radius -->
</shape>

View file

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<com.adins.mss.foundation.questiongenerator.form.QuestionView
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/questionTextLookup">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/questionLookupLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="0. Label"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<Button
android:id="@+id/btnChooseLookup"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_gravity="center"
android:layout_weight="0.5"
android:gravity="center|center_vertical"
android:background="@drawable/button_background"
android:text="@string/chooseLookup"
android:textColor="@color/fontColorWhite"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:layout_marginTop="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="5dp"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<TextView
android:id="@+id/txtSelectedAnswer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="10dp"
android:paddingTop="5dp"
android:text="@string/selectedAnswer"
android:layout_span="2"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<TableLayout
android:id="@+id/questionLookupAnswerLayout"
android:layout_width="match_parent"
android:stretchColumns="1"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:paddingHorizontal="10dp"
android:layout_margin="5dp"
android:visibility="visible">
</TableLayout>
<TextView
android:id="@+id/questionLookupAnswer"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"/>
</LinearLayout>
</ScrollView>
</com.adins.mss.foundation.questiongenerator.form.QuestionView>

View file

@ -0,0 +1,106 @@
package fr.castorflex.android.smoothprogressbar;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
/**
* This is a copy of the ContentLoadingProgressBar from the support library, but extends
* SmoothProgressBar.
*/
public class ContentLoadingSmoothProgressBar extends SmoothProgressBar {
private static final int MIN_SHOW_TIME = 500; // ms
private static final int MIN_DELAY = 500; // ms
private long mStartTime = -1;
private boolean mPostedHide = false;
private final Runnable mDelayedHide = new Runnable() {
@Override
public void run() {
mPostedHide = false;
mStartTime = -1;
setVisibility(View.GONE);
}
};
private boolean mPostedShow = false;
private boolean mDismissed = false;
private final Runnable mDelayedShow = new Runnable() {
@Override
public void run() {
mPostedShow = false;
if (!mDismissed) {
mStartTime = System.currentTimeMillis();
setVisibility(View.VISIBLE);
}
}
};
public ContentLoadingSmoothProgressBar(Context context) {
this(context, null);
}
public ContentLoadingSmoothProgressBar(Context context, AttributeSet attrs) {
super(context, attrs, 0);
}
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
removeCallbacks();
}
@Override
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
removeCallbacks();
}
private void removeCallbacks() {
removeCallbacks(mDelayedHide);
removeCallbacks(mDelayedShow);
}
/**
* Hide the progress view if it is visible. The progress view will not be
* hidden until it has been shown for at least a minimum show time. If the
* progress view was not yet visible, cancels showing the progress view.
*/
public void hide() {
mDismissed = true;
removeCallbacks(mDelayedShow);
long diff = System.currentTimeMillis() - mStartTime;
if (diff >= MIN_SHOW_TIME || mStartTime == -1) {
// The progress spinner has been shown long enough
// OR was not shown yet. If it wasn't shown yet,
// it will just never be shown.
setVisibility(View.GONE);
} else {
// The progress spinner is shown, but not long enough,
// so put a delayed message in to hide it when its been
// shown long enough.
if (!mPostedHide) {
postDelayed(mDelayedHide, MIN_SHOW_TIME - diff);
mPostedHide = true;
}
}
}
/**
* Show the progress view after waiting for a minimum delay. If
* during that time, hide() is called, the view is never made visible.
*/
public void show() {
// Reset the start time.
mStartTime = -1;
mDismissed = false;
removeCallbacks(mDelayedHide);
if (!mPostedShow) {
postDelayed(mDelayedShow, MIN_DELAY);
mPostedShow = true;
}
}
}

View file

@ -0,0 +1,225 @@
package com.adins.mss.dao;
import com.adins.mss.dao.DaoSession;
import de.greenrobot.dao.DaoException;
import com.adins.mss.base.util.ExcludeFromGson;
import com.google.gson.annotations.SerializedName;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit.
/**
* Entity mapped to table "TR_PLAN_TASK".
*/
public class PlanTask {
/** Not-null value. */
@SerializedName("uuid_plan_task")
private String uuid_plan_task;
@SerializedName("sequence")
private int sequence;
/** Not-null value. */
@SerializedName("plan_status")
private String plan_status;
@SerializedName("plan_start_date")
private java.util.Date plan_start_date;
@SerializedName("plan_crt_date")
private java.util.Date plan_crt_date;
@SerializedName("view_sequence")
private Integer view_sequence;
/** Not-null value. */
@SerializedName("uuid_user")
private String uuid_user;
/** Not-null value. */
@SerializedName("uuid_task_h")
private String uuid_task_h;
/** Used to resolve relations */
private transient DaoSession daoSession;
/** Used for active entity operations. */
private transient PlanTaskDao myDao;
private TaskH taskH;
private String taskH__resolvedKey;
private User user;
private String user__resolvedKey;
public PlanTask() {
}
public PlanTask(String uuid_plan_task) {
this.uuid_plan_task = uuid_plan_task;
}
public PlanTask(String uuid_plan_task, int sequence, String plan_status, java.util.Date plan_start_date, java.util.Date plan_crt_date, Integer view_sequence, String uuid_user, String uuid_task_h) {
this.uuid_plan_task = uuid_plan_task;
this.sequence = sequence;
this.plan_status = plan_status;
this.plan_start_date = plan_start_date;
this.plan_crt_date = plan_crt_date;
this.view_sequence = view_sequence;
this.uuid_user = uuid_user;
this.uuid_task_h = uuid_task_h;
}
/** called by internal mechanisms, do not call yourself. */
public void __setDaoSession(DaoSession daoSession) {
this.daoSession = daoSession;
myDao = daoSession != null ? daoSession.getPlanTaskDao() : null;
}
/** Not-null value. */
public String getUuid_plan_task() {
return uuid_plan_task;
}
/** Not-null value; ensure this value is available before it is saved to the database. */
public void setUuid_plan_task(String uuid_plan_task) {
this.uuid_plan_task = uuid_plan_task;
}
public int getSequence() {
return sequence;
}
public void setSequence(int sequence) {
this.sequence = sequence;
}
/** Not-null value. */
public String getPlan_status() {
return plan_status;
}
/** Not-null value; ensure this value is available before it is saved to the database. */
public void setPlan_status(String plan_status) {
this.plan_status = plan_status;
}
public java.util.Date getPlan_start_date() {
return plan_start_date;
}
public void setPlan_start_date(java.util.Date plan_start_date) {
this.plan_start_date = plan_start_date;
}
public java.util.Date getPlan_crt_date() {
return plan_crt_date;
}
public void setPlan_crt_date(java.util.Date plan_crt_date) {
this.plan_crt_date = plan_crt_date;
}
public Integer getView_sequence() {
return view_sequence;
}
public void setView_sequence(Integer view_sequence) {
this.view_sequence = view_sequence;
}
/** Not-null value. */
public String getUuid_user() {
return uuid_user;
}
/** Not-null value; ensure this value is available before it is saved to the database. */
public void setUuid_user(String uuid_user) {
this.uuid_user = uuid_user;
}
/** Not-null value. */
public String getUuid_task_h() {
return uuid_task_h;
}
/** Not-null value; ensure this value is available before it is saved to the database. */
public void setUuid_task_h(String uuid_task_h) {
this.uuid_task_h = uuid_task_h;
}
/** To-one relationship, resolved on first access. */
public TaskH getTaskH() {
String __key = this.uuid_task_h;
if (taskH__resolvedKey == null || taskH__resolvedKey != __key) {
if (daoSession == null) {
throw new DaoException("Entity is detached from DAO context");
}
TaskHDao targetDao = daoSession.getTaskHDao();
TaskH taskHNew = targetDao.load(__key);
synchronized (this) {
taskH = taskHNew;
taskH__resolvedKey = __key;
}
}
return taskH;
}
public void setTaskH(TaskH taskH) {
if (taskH == null) {
throw new DaoException("To-one property 'uuid_task_h' has not-null constraint; cannot set to-one to null");
}
synchronized (this) {
this.taskH = taskH;
uuid_task_h = taskH.getUuid_task_h();
taskH__resolvedKey = uuid_task_h;
}
}
/** To-one relationship, resolved on first access. */
public User getUser() {
String __key = this.uuid_user;
if (user__resolvedKey == null || user__resolvedKey != __key) {
if (daoSession == null) {
throw new DaoException("Entity is detached from DAO context");
}
UserDao targetDao = daoSession.getUserDao();
User userNew = targetDao.load(__key);
synchronized (this) {
user = userNew;
user__resolvedKey = __key;
}
}
return user;
}
public void setUser(User user) {
if (user == null) {
throw new DaoException("To-one property 'uuid_user' has not-null constraint; cannot set to-one to null");
}
synchronized (this) {
this.user = user;
uuid_user = user.getUuid_user();
user__resolvedKey = uuid_user;
}
}
/** Convenient call for {@link AbstractDao#delete(Object)}. Entity must attached to an entity context. */
public void delete() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.delete(this);
}
/** Convenient call for {@link AbstractDao#update(Object)}. Entity must attached to an entity context. */
public void update() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.update(this);
}
/** Convenient call for {@link AbstractDao#refresh(Object)}. Entity must attached to an entity context. */
public void refresh() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.refresh(this);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View file

@ -0,0 +1,194 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bgColor" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginBottom="60dp">
<androidx.cardview.widget.CardView
android:id="@+id/depositReportContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="10dp"
app:contentPadding="7dp"
app:cardElevation="@dimen/card_shadow"
android:layout_margin="@dimen/card_margin"
app:cardBackgroundColor="@color/fontColorWhite">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/deposit_report"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold"
android:textColor="@color/colorMC"
android:paddingBottom="10dp"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/transferBySpinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:spinnerMode="dropdown"
android:background="@drawable/dropdown_background"
android:padding="5dp"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_expand"
android:layout_alignRight="@+id/transferBySpinner"
android:layout_alignBottom="@+id/transferBySpinner"
android:layout_alignTop="@+id/transferBySpinner"
android:layout_marginRight="10dp"
android:tint="@color/colorMC"/>
</RelativeLayout>
<LinearLayout
android:id="@+id/transferAsBank"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/lblAccountNo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/label_account_number_2"
android:textAppearance="?android:attr/textAppearanceSmall" />
<EditText
android:id="@+id/txtAccountNo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"
android:textColorHint="@color/shadowColor"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_marginBottom="3dp"
android:padding="10dp"
android:imeOptions="actionNext"
android:inputType="number"/>
<TextView
android:id="@+id/lblBankName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/label_bank_name_2"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<EditText
android:id="@+id/txtBankName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"
android:textColorHint="@color/shadowColor"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_marginBottom="3dp"
android:padding="10dp"
android:imeOptions="actionDone"
android:inputType="text"/>
<TextView
android:id="@+id/lblBatchId"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/label_batch_id_2"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<EditText
android:id="@+id/txtBatchId"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"
android:textColorHint="@color/shadowColor"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_marginBottom="3dp"
android:textColor="@color/disabledFontColor"
android:padding="10dp"
android:enabled="false"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/lblTransferEvidence"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/label_transfer_evidence_2"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<ImageView
android:id="@+id/imgBukti"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginRight="5dp"
android:background="@drawable/dropdown_background"
android:layout_alignParentRight="true"/>
<Button
android:id="@+id/btnTakePhoto"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="5dp"
android:layout_below="@id/lblTransferEvidence"
android:layout_marginRight="50dp"
android:layout_toLeftOf="@id/imgBukti"
android:layout_marginTop="25dp"
android:background="@drawable/button_background"
android:text="@string/take_a_photo"
android:textColor="@color/fontColorWhite"
android:textAppearance="?android:attr/textAppearanceSmall"/>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/transferAsCashier"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:id="@+id/lblCashierName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/label_cashier_name_2"
android:textAppearance="?android:attr/textAppearanceSmall" />
<EditText
android:id="@+id/txtCashierName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"
android:imeOptions="actionDone"
android:inputType="text"
android:padding="10dp"
android:textColorHint="@color/shadowColor"
android:textAppearance="?android:attr/textAppearanceSmall"/>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</ScrollView>
<Button
android:id="@+id/btnSend"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="5dp"
android:background="@drawable/button_background"
android:text="@string/btnSend"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/fontColorWhite" />
</RelativeLayout>
</LinearLayout>

View file

@ -0,0 +1,270 @@
package com.adins.mss.foundation.formatter;
//Class in android.util.Base64 since: API Level 8
/**
* A Base64 encoder/decoder.
* <p>
* <p>
* This class is used to encode and decode data in Base64 format as described in
* RFC 1521.
* <p>
* <p>
* Project home page: <a
* href="http://www.source-code.biz/base64coder/java/">www.
* source-code.biz/base64coder/java</a><br>
* Author: Christian d'Heureuse, Inventec Informatik AG, Zurich, Switzerland<br>
* Multi-licensed: EPL / LGPL / AL / BSD.
*/
public class Base64 {
// The line separator string of the operating system.
private static final String systemLineSeparator = System.getProperty("line.separator");
// Mapping table from 6-bit nibbles to Base64 characters.
private static char[] map1 = new char[64];
// Mapping table from Base64 characters to 6-bit nibbles.
private static byte[] map2 = new byte[128];
static {
int i = 0;
for (char c = 'A'; c <= 'Z'; c++)
map1[i++] = c;
for (char c = 'a'; c <= 'z'; c++)
map1[i++] = c;
for (char c = '0'; c <= '9'; c++)
map1[i++] = c;
map1[i++] = '+';
map1[i++] = '/';
}
static {
for (int i = 0; i < map2.length; i++)
map2[i] = -1;
for (int i = 0; i < 64; i++)
map2[map1[i]] = (byte) i;
}
// Dummy constructor.
private Base64() {
}
/**
* Encodes a string into Base64 format. No blanks or line breaks are
* inserted.
*
* @param s A String to be encoded.
* @return A String containing the Base64 encoded data.
*/
public static String encodeString(String s) {
return new String(encode(s.getBytes()));
}
/**
* Encodes a byte array into Base 64 format and breaks the output into lines
* of 76 characters. This method is compatible with
* <code>sun.misc.BASE64Encoder.encodeBuffer(byte[])</code>.
*
* @param in An array containing the data bytes to be encoded.
* @return A String containing the Base64 encoded data, broken into lines.
*/
public static String encodeLines(byte[] in) {
return encodeLines(in, 0, in.length, 76, systemLineSeparator);
}
/**
* Encodes a byte array into Base 64 format and breaks the output into
* lines.
*
* @param in An array containing the data bytes to be encoded.
* @param iOff Offset of the first byte in <code>in</code> to be processed.
* @param iLen Number of bytes to be processed in <code>in</code>, starting
* at <code>iOff</code>.
* @param lineLen Line length for the output data. Should be a multiple of 4.
* @param lineSeparator The line separator to be used to separate the output lines.
* @return A String containing the Base64 encoded data, broken into lines.
*/
public static String encodeLines(byte[] in, int iOff, int iLen,
int lineLen, String lineSeparator) {
int blockLen = (lineLen * 3) / 4;
if (blockLen <= 0)
throw new IllegalArgumentException();
int lines = (iLen + blockLen - 1) / blockLen;
int bufLen = ((iLen + 2) / 3) * 4 + lines * lineSeparator.length();
StringBuilder buf = new StringBuilder(bufLen);
int ip = 0;
while (ip < iLen) {
int l = Math.min(iLen - ip, blockLen);
buf.append(encode(in, iOff + ip, l));
buf.append(lineSeparator);
ip += l;
}
return buf.toString();
}
/**
* Encodes a byte array into Base64 format. No blanks or line breaks are
* inserted in the output.
*
* @param in An array containing the data bytes to be encoded.
* @return A character array containing the Base64 encoded data.
*/
public static char[] encode(byte[] in) {
return encode(in, 0, in.length);
}
/**
* Encodes a byte array into Base64 format. No blanks or line breaks are
* inserted in the output.
*
* @param in An array containing the data bytes to be encoded.
* @param iLen Number of bytes to process in <code>in</code>.
* @return A character array containing the Base64 encoded data.
*/
public static char[] encode(byte[] in, int iLen) {
return encode(in, 0, iLen);
}
/**
* Encodes a byte array into Base64 format. No blanks or line breaks are
* inserted in the output.
*
* @param in An array containing the data bytes to be encoded.
* @param iOff Offset of the first byte in <code>in</code> to be processed.
* @param iLen Number of bytes to process in <code>in</code>, starting at
* <code>iOff</code>.
* @return A character array containing the Base64 encoded data.
*/
public static char[] encode(byte[] in, int iOff, int iLen) {
int oDataLen = (iLen * 4 + 2) / 3; // output length without padding
int oLen = ((iLen + 2) / 3) * 4; // output length including padding
char[] out = new char[oLen];
int ip = iOff;
int iEnd = iOff + iLen;
int op = 0;
while (ip < iEnd) {
int i0 = in[ip++] & 0xff;
int i1 = ip < iEnd ? in[ip++] & 0xff : 0;
int i2 = ip < iEnd ? in[ip++] & 0xff : 0;
int o0 = i0 >>> 2;
int o1 = ((i0 & 3) << 4) | (i1 >>> 4);
int o2 = ((i1 & 0xf) << 2) | (i2 >>> 6);
int o3 = i2 & 0x3F;
out[op++] = map1[o0];
out[op++] = map1[o1];
out[op] = op < oDataLen ? map1[o2] : '=';
op++;
out[op] = op < oDataLen ? map1[o3] : '=';
op++;
}
return out;
}
/**
* Decodes a string from Base64 format. No blanks or line breaks are allowed
* within the Base64 encoded input data.
*
* @param s A Base64 String to be decoded.
* @return A String containing the decoded data.
* @throws IllegalArgumentException If the input is not valid Base64 encoded data.
*/
public static String decodeString(String s) {
return new String(decode(s));
}
/**
* Decodes a byte array from Base64 format and ignores line separators, tabs
* and blanks. CR, LF, Tab and Space characters are ignored in the input
* data. This method is compatible with
* <code>sun.misc.BASE64Decoder.decodeBuffer(String)</code>.
*
* @param s A Base64 String to be decoded.
* @return An array containing the decoded data bytes.
* @throws IllegalArgumentException If the input is not valid Base64 encoded data.
*/
public static byte[] decodeLines(String s) {
char[] buf = new char[s.length()];
int p = 0;
for (int ip = 0; ip < s.length(); ip++) {
char c = s.charAt(ip);
if (c != ' ' && c != '\r' && c != '\n' && c != '\t')
buf[p++] = c;
}
return decode(buf, 0, p);
}
/**
* Decodes a byte array from Base64 format. No blanks or line breaks are
* allowed within the Base64 encoded input data.
*
* @param s A Base64 String to be decoded.
* @return An array containing the decoded data bytes.
* @throws IllegalArgumentException If the input is not valid Base64 encoded data.
*/
public static byte[] decode(String s) {
return decode(s.toCharArray());
}
/**
* Decodes a byte array from Base64 format. No blanks or line breaks are
* allowed within the Base64 encoded input data.
*
* @param in A character array containing the Base64 encoded data.
* @return An array containing the decoded data bytes.
* @throws IllegalArgumentException If the input is not valid Base64 encoded data.
*/
public static byte[] decode(char[] in) {
return decode(in, 0, in.length);
}
/**
* Decodes a byte array from Base64 format. No blanks or line breaks are
* allowed within the Base64 encoded input data.
*
* @param in A character array containing the Base64 encoded data.
* @param iOff Offset of the first character in <code>in</code> to be
* processed.
* @param iLen Number of characters to process in <code>in</code>, starting
* at <code>iOff</code>.
* @return An array containing the decoded data bytes.
* @throws IllegalArgumentException If the input is not valid Base64 encoded data.
*/
public static byte[] decode(char[] in, int iOff, int iLen) {
if (iLen % 4 != 0)
throw new IllegalArgumentException(
"Length of Base64 encoded input string is not a multiple of 4.");
while (iLen > 0 && in[iOff + iLen - 1] == '=')
iLen--;
int oLen = (iLen * 3) / 4;
byte[] out = new byte[oLen];
int ip = iOff;
int iEnd = iOff + iLen;
int op = 0;
while (ip < iEnd) {
int i0 = in[ip++];
int i1 = in[ip++];
int i2 = ip < iEnd ? in[ip++] : 'A';
int i3 = ip < iEnd ? in[ip++] : 'A';
if (i0 > 127 || i1 > 127 || i2 > 127 || i3 > 127)
throw new IllegalArgumentException(
"Illegal character in Base64 encoded data.");
int b0 = map2[i0];
int b1 = map2[i1];
int b2 = map2[i2];
int b3 = map2[i3];
if (b0 < 0 || b1 < 0 || b2 < 0 || b3 < 0)
throw new IllegalArgumentException(
"Illegal character in Base64 encoded data.");
int o0 = (b0 << 2) | (b1 >>> 4);
int o1 = ((b1 & 0xf) << 4) | (b2 >>> 2);
int o2 = ((b2 & 3) << 6) | b3;
out[op++] = (byte) o0;
if (op < oLen)
out[op++] = (byte) o1;
if (op < oLen)
out[op++] = (byte) o2;
}
return out;
}
} // end class Base64Coder