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,311 @@
package com.adins.mss.dao;
import java.util.List;
import java.util.ArrayList;
import android.database.Cursor;
import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.Property;
import de.greenrobot.dao.internal.SqlUtils;
import de.greenrobot.dao.internal.DaoConfig;
import de.greenrobot.dao.database.Database;
import de.greenrobot.dao.database.DatabaseStatement;
import de.greenrobot.dao.query.Query;
import de.greenrobot.dao.query.QueryBuilder;
import com.adins.mss.dao.PrintItem;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "MS_PRINTITEM".
*/
public class PrintItemDao extends AbstractDao<PrintItem, String> {
public static final String TABLENAME = "MS_PRINTITEM";
/**
* Properties of entity PrintItem.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property Uuid_print_item = new Property(0, String.class, "uuid_print_item", true, "UUID_PRINT_ITEM");
public final static Property Print_type_id = new Property(1, String.class, "print_type_id", false, "PRINT_TYPE_ID");
public final static Property Print_item_label = new Property(2, String.class, "print_item_label", false, "PRINT_ITEM_LABEL");
public final static Property Question_group_id = new Property(3, String.class, "question_group_id", false, "QUESTION_GROUP_ID");
public final static Property Question_id = new Property(4, String.class, "question_id", false, "QUESTION_ID");
public final static Property Print_item_order = new Property(5, Integer.class, "print_item_order", false, "PRINT_ITEM_ORDER");
public final static Property Usr_crt = new Property(6, String.class, "usr_crt", false, "USR_CRT");
public final static Property Dtm_crt = new Property(7, java.util.Date.class, "dtm_crt", false, "DTM_CRT");
public final static Property Usr_upd = new Property(8, String.class, "usr_upd", false, "USR_UPD");
public final static Property Dtm_upd = new Property(9, java.util.Date.class, "dtm_upd", false, "DTM_UPD");
public final static Property Uuid_scheme = new Property(10, String.class, "uuid_scheme", false, "UUID_SCHEME");
};
private DaoSession daoSession;
private Query<PrintItem> scheme_PrintItemListQuery;
public PrintItemDao(DaoConfig config) {
super(config);
}
public PrintItemDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
this.daoSession = daoSession;
}
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
String constraint = ifNotExists? "IF NOT EXISTS ": "";
db.execSQL("CREATE TABLE " + constraint + "\"MS_PRINTITEM\" (" + //
"\"UUID_PRINT_ITEM\" TEXT PRIMARY KEY NOT NULL ," + // 0: uuid_print_item
"\"PRINT_TYPE_ID\" TEXT," + // 1: print_type_id
"\"PRINT_ITEM_LABEL\" TEXT," + // 2: print_item_label
"\"QUESTION_GROUP_ID\" TEXT," + // 3: question_group_id
"\"QUESTION_ID\" TEXT," + // 4: question_id
"\"PRINT_ITEM_ORDER\" INTEGER," + // 5: print_item_order
"\"USR_CRT\" TEXT," + // 6: usr_crt
"\"DTM_CRT\" INTEGER," + // 7: dtm_crt
"\"USR_UPD\" TEXT," + // 8: usr_upd
"\"DTM_UPD\" INTEGER," + // 9: dtm_upd
"\"UUID_SCHEME\" TEXT);"); // 10: uuid_scheme
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"MS_PRINTITEM\"";
db.execSQL(sql);
}
/** @inheritdoc */
@Override
protected void bindValues(DatabaseStatement stmt, PrintItem entity) {
stmt.clearBindings();
stmt.bindString(1, entity.getUuid_print_item());
String print_type_id = entity.getPrint_type_id();
if (print_type_id != null) {
stmt.bindString(2, print_type_id);
}
String print_item_label = entity.getPrint_item_label();
if (print_item_label != null) {
stmt.bindString(3, print_item_label);
}
String question_group_id = entity.getQuestion_group_id();
if (question_group_id != null) {
stmt.bindString(4, question_group_id);
}
String question_id = entity.getQuestion_id();
if (question_id != null) {
stmt.bindString(5, question_id);
}
Integer print_item_order = entity.getPrint_item_order();
if (print_item_order != null) {
stmt.bindLong(6, print_item_order);
}
String usr_crt = entity.getUsr_crt();
if (usr_crt != null) {
stmt.bindString(7, usr_crt);
}
java.util.Date dtm_crt = entity.getDtm_crt();
if (dtm_crt != null) {
stmt.bindLong(8, dtm_crt.getTime());
}
String usr_upd = entity.getUsr_upd();
if (usr_upd != null) {
stmt.bindString(9, usr_upd);
}
java.util.Date dtm_upd = entity.getDtm_upd();
if (dtm_upd != null) {
stmt.bindLong(10, dtm_upd.getTime());
}
String uuid_scheme = entity.getUuid_scheme();
if (uuid_scheme != null) {
stmt.bindString(11, uuid_scheme);
}
}
@Override
protected void attachEntity(PrintItem entity) {
super.attachEntity(entity);
entity.__setDaoSession(daoSession);
}
/** @inheritdoc */
@Override
public String readKey(Cursor cursor, int offset) {
return cursor.getString(offset + 0);
}
/** @inheritdoc */
@Override
public PrintItem readEntity(Cursor cursor, int offset) {
PrintItem entity = new PrintItem( //
cursor.getString(offset + 0), // uuid_print_item
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // print_type_id
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // print_item_label
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // question_group_id
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // question_id
cursor.isNull(offset + 5) ? null : cursor.getInt(offset + 5), // print_item_order
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // usr_crt
cursor.isNull(offset + 7) ? null : new java.util.Date(cursor.getLong(offset + 7)), // dtm_crt
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // usr_upd
cursor.isNull(offset + 9) ? null : new java.util.Date(cursor.getLong(offset + 9)), // dtm_upd
cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10) // uuid_scheme
);
return entity;
}
/** @inheritdoc */
@Override
public void readEntity(Cursor cursor, PrintItem entity, int offset) {
entity.setUuid_print_item(cursor.getString(offset + 0));
entity.setPrint_type_id(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setPrint_item_label(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setQuestion_group_id(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setQuestion_id(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setPrint_item_order(cursor.isNull(offset + 5) ? null : cursor.getInt(offset + 5));
entity.setUsr_crt(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setDtm_crt(cursor.isNull(offset + 7) ? null : new java.util.Date(cursor.getLong(offset + 7)));
entity.setUsr_upd(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
entity.setDtm_upd(cursor.isNull(offset + 9) ? null : new java.util.Date(cursor.getLong(offset + 9)));
entity.setUuid_scheme(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10));
}
/** @inheritdoc */
@Override
protected String updateKeyAfterInsert(PrintItem entity, long rowId) {
return entity.getUuid_print_item();
}
/** @inheritdoc */
@Override
public String getKey(PrintItem entity) {
if(entity != null) {
return entity.getUuid_print_item();
} else {
return null;
}
}
/** @inheritdoc */
@Override
protected boolean isEntityUpdateable() {
return true;
}
/** Internal query to resolve the "printItemList" to-many relationship of Scheme. */
public List<PrintItem> _queryScheme_PrintItemList(String uuid_scheme) {
synchronized (this) {
if (scheme_PrintItemListQuery == null) {
QueryBuilder<PrintItem> queryBuilder = queryBuilder();
queryBuilder.where(Properties.Uuid_scheme.eq(null));
scheme_PrintItemListQuery = queryBuilder.build();
}
}
Query<PrintItem> query = scheme_PrintItemListQuery.forCurrentThread();
query.setParameter(0, uuid_scheme);
return query.list();
}
private String selectDeep;
protected String getSelectDeep() {
if (selectDeep == null) {
StringBuilder builder = new StringBuilder("SELECT ");
SqlUtils.appendColumns(builder, "T", getAllColumns());
builder.append(',');
SqlUtils.appendColumns(builder, "T0", daoSession.getSchemeDao().getAllColumns());
builder.append(" FROM MS_PRINTITEM T");
builder.append(" LEFT JOIN MS_SCHEME T0 ON T.\"UUID_SCHEME\"=T0.\"UUID_SCHEME\"");
builder.append(' ');
selectDeep = builder.toString();
}
return selectDeep;
}
protected PrintItem loadCurrentDeep(Cursor cursor, boolean lock) {
PrintItem entity = loadCurrent(cursor, 0, lock);
int offset = getAllColumns().length;
Scheme scheme = loadCurrentOther(daoSession.getSchemeDao(), cursor, offset);
entity.setScheme(scheme);
return entity;
}
public PrintItem loadDeep(Long key) {
assertSinglePk();
if (key == null) {
return null;
}
StringBuilder builder = new StringBuilder(getSelectDeep());
builder.append("WHERE ");
SqlUtils.appendColumnsEqValue(builder, "T", getPkColumns());
String sql = builder.toString();
String[] keyArray = new String[] { key.toString() };
Cursor cursor = db.rawQuery(sql, keyArray);
try {
boolean available = cursor.moveToFirst();
if (!available) {
return null;
} else if (!cursor.isLast()) {
throw new IllegalStateException("Expected unique result, but count was " + cursor.getCount());
}
return loadCurrentDeep(cursor, true);
} finally {
cursor.close();
}
}
/** Reads all available rows from the given cursor and returns a list of new ImageTO objects. */
public List<PrintItem> loadAllDeepFromCursor(Cursor cursor) {
int count = cursor.getCount();
List<PrintItem> list = new ArrayList<PrintItem>(count);
if (cursor.moveToFirst()) {
if (identityScope != null) {
identityScope.lock();
identityScope.reserveRoom(count);
}
try {
do {
list.add(loadCurrentDeep(cursor, false));
} while (cursor.moveToNext());
} finally {
if (identityScope != null) {
identityScope.unlock();
}
}
}
return list;
}
protected List<PrintItem> loadDeepAllAndCloseCursor(Cursor cursor) {
try {
return loadAllDeepFromCursor(cursor);
} finally {
cursor.close();
}
}
/** A raw-style query where you can pass any WHERE clause and arguments. */
public List<PrintItem> queryDeep(String where, String... selectionArg) {
Cursor cursor = db.rawQuery(getSelectDeep() + where, selectionArg);
return loadDeepAllAndCloseCursor(cursor);
}
}

View file

@ -0,0 +1,122 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/main_activity">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/toolbarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:theme="@style/ThemeOverlay.AppCompat.ActionBar">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:background="@drawable/header"
app:titleTextAppearance="?android:attr/textAppearanceSmall"
android:titleTextColor="@color/fontColorWhite"
app:popupTheme="@style/ThemeOverlay.AppCompat.ActionBar"
app:layout_collapseMode="pin"
android:fitsSystemWindows="true">
<RelativeLayout
android:id="@+id/spinner"
android:layout_width="265sp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_margin="5dp"
android:layout_gravity="center_vertical|left"
android:background="@drawable/search_background"
android:visibility="gone">
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/spinnerSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/fontColorWhite"
android:background="@color/gradient_start"
android:layout_centerVertical="true"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_search_white"
android:paddingLeft="5dp"
android:layout_centerVertical="true"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/search"
android:layout_width="215sp"
android:layout_height="wrap_content"
android:background="@drawable/search_background"
android:gravity="center_vertical"
android:layout_margin="5dp"
android:visibility="gone">
<ImageButton
android:id="@+id/buttonSearch"
android:layout_width="match_parent"
android:layout_height="25sp"
android:background="@color/gradient_start"
android:layout_centerVertical="true"/>
<TextView
android:id="@+id/searchTask"
android:layout_width="260dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:textAppearance="?android:attr/textAppearanceSmall"
android:drawableLeft="@drawable/ic_search_white"
android:drawablePadding="10dp"
android:text="@string/all_form_all_task"
android:textColor="@color/fontColorWhite" />
</RelativeLayout>
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_below="@id/toolbarLayout"
android:layout_above="@id/container"
android:layout_weight="1"
android:background="@color/bgColor"/>
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<com.google.android.material.bottomnavigation.BottomNavigationView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/bottomNav"
android:layout_gravity="bottom"
android:background="@drawable/bottomnav_background"
app:menu="@menu/new_nav_item"
app:itemIconTint="@color/bottomnav_color_selector"
app:itemTextColor="@color/bottomnav_color_selector"/>
</FrameLayout>
<TextView
android:id="@+id/counter"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="35dp"
android:layout_marginRight="33dp"
android:text="99"
android:textColor="@color/fontColorWhite"
android:textSize="7dp"
android:gravity="center"
android:elevation="5dp"
android:background="@drawable/counter_bg"/>
</RelativeLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View file

@ -0,0 +1,27 @@
package com.adins.mss.base.login;
import android.location.LocationListener;
import android.location.LocationManager;
import com.adins.mss.foundation.security.storepreferences.ObscuredSharedPreferences;
/**
* Created by kusnendi.muhamad on 26/07/2017.
*/
public interface LoginInterface extends LocationListener {
public boolean isRooted();
public void initializePreferences();
public void bindLocationListener();
public void removeUpdateLocation();
public LocationManager getLocationManager();
public ObscuredSharedPreferences getSharedPref();
public ObscuredSharedPreferences getLoginPreferences();
// public void setModel(DefaultLoginModel dataContex);
}

View file

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mainFrame"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginBottom="70dp">
<TextView android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/history_payment"
style="@style/PageTextTitle"/>
<ExpandableListView
android:id="@+id/list"
android:layout_height="fill_parent"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_marginTop="10dp"
android:groupIndicator="@null"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="bottom">
<ImageButton
android:id="@+id/imageBtnDownload"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic_download"
android:background="@android:color/transparent"/>
</LinearLayout>
</FrameLayout>

View file

@ -0,0 +1,190 @@
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/bgColorWhite"
android:weightSum="1">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.03"
android:layout_marginTop="5dp">
<LinearLayout
android:orientation="horizontal"
android:id="@+id/imageView3"
android:layout_width="70dp"
android:layout_height="70dp"
android:background="@drawable/circle_thumbnail"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true">
<TextView
android:id="@+id/txtThumbnailCircleAccDetail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="MA"
android:textSize="27dp"
android:textStyle="bold"
android:gravity="center"
android:textColor="@color/fontColorWhite"/>
</LinearLayout>
</RelativeLayout>
<TextView
android:id="@+id/txtNameAccDetail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Muhammad Audi"
android:textSize="22dp"
android:textStyle="bold"
android:gravity="center"
android:textColor="@color/fontColorDarkGrey"
android:layout_marginBottom="20dp"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_margin="1dp">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:layout_gravity="left"
android:orientation="horizontal"
android:layout_centerVertical="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="2dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Customer Address"
android:textAppearance="?android:attr/textAppearanceSmall"
android:drawableLeft="@drawable/ic_location_color"
android:drawablePadding="4dp"
android:textStyle="bold"
android:textSize="17dp"
android:textColor="@color/fontColorDarkGreen"/>
<EditText
android:id="@+id/txtAddressAccDetail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Jl. Raya Kb. Jeruk No.80 Jakarta Barat"
android:textSize="14dp"
android:layout_weight="1"
android:layout_marginLeft="26dp"
android:textColor="@color/fontColorDarkGrey"
android:background="@android:color/transparent"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:layout_gravity="left"
android:orientation="horizontal"
android:layout_centerVertical="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="2dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Customer Phone"
android:textAppearance="?android:attr/textAppearanceSmall"
android:drawableLeft="@drawable/ic_phone_color"
android:drawablePadding="6dp"
android:textStyle="bold"
android:textSize="17dp"
android:textColor="@color/fontColorDarkGreen"/>
<EditText
android:id="@+id/txtNumber1Acc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="30dp"
android:layout_weight="1"
android:background="@android:color/transparent"
android:text="0812345678910"
android:textColor="@color/fontColorDarkGrey"
android:textSize="14dp"
android:inputType="number"/>
<EditText
android:id="@+id/txtNumber2Acc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="0812345678910"
android:textSize="14dp"
android:layout_weight="1"
android:layout_marginLeft="30dp"
android:textColor="@color/fontColorDarkGrey"
android:background="@android:color/transparent"
android:inputType="number"/>
<EditText
android:id="@+id/txtNumber3Acc"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="0812345678910"
android:textSize="14dp"
android:layout_weight="1"
android:layout_marginLeft="30dp"
android:textColor="@color/fontColorDarkGrey"
android:background="@android:color/transparent"
android:inputType="number"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<Button
android:id="@+id/btnNewProspectAcc"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_gravity="center"
android:layout_marginTop="15dp"
android:background="@drawable/button_background"
android:text="@string/btnNewProspect"
android:textColor="@color/fontColorDarkGrey"
android:textSize="17dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.96">
<com.adins.mss.base.dynamicform.form.questions.viewholder.ExpandableRecyclerView
android:id="@+id/btnOpportunities"
android:name="com.adins.mss.base.dynamicform.form.QuestionFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusableInTouchMode="false"
app:layoutManager="LinearLayoutManager"
android:layout_marginTop="5dp"/>
</RelativeLayout>
</LinearLayout>

View file

@ -0,0 +1,47 @@
package com.adins.mss.foundation.sync.api.model;
import com.google.gson.annotations.SerializedName;
/**
* Created by gigin.ginanjar on 29/09/2016.
*/
public class SynchronizeCOHRequestModel extends SynchronizeRequestModel {
@SerializedName("cashOnHand")
private String cashOnHand;
@SerializedName("cashLimit")
private String cashLimit;
@SerializedName("login_ID")
private String login_ID;
public SynchronizeCOHRequestModel() {
}
public SynchronizeCOHRequestModel(SynchronizeRequestModel requestModel) {
super(requestModel);
}
public String getCashOnHand() {
return cashOnHand;
}
public void setCashOnHand(String cashOnHand) {
this.cashOnHand = cashOnHand;
}
public String getCashLimit() {
return cashLimit;
}
public void setCashLimit(String cashLimit) {
this.cashLimit = cashLimit;
}
public String getLogin_ID() {
return login_ID;
}
public void setLogin_ID(String login_ID) {
this.login_ID = login_ID;
}
}

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<!-- <item android:id="@+id/recapitulation" android:showAsAction="never" -->
<!-- android:title="Recapitulation"/> -->
<!-- <item android:id="@+id/summary" android:showAsAction="never" -->
<!-- android:title="Summary"/> -->
</menu>

View file

@ -0,0 +1,497 @@
package com.adins.mss.base.syncfile;
import android.content.Context;
import com.adins.mss.dao.DaoSession;
import com.adins.mss.dao.MobileDataFile;
import com.adins.mss.dao.MobileDataFileDao;
import com.adins.mss.foundation.db.DaoOpenHelper;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import de.greenrobot.dao.query.QueryBuilder;
/**
* Created by loise on 10/16/2017.
* <p>
* Tambahkan code berikut di mssdaogenerator dan generate database baru.
* INGAT : setiap kali ada perubahan db harus ditimpa ulang dengan isi berikut karena file akan tergenerate ulang oleh DAOgenerator
* //MS_MOBILEDATAFILES
* Entity mobileDataFiles = schema.addEntity("mobiledatafile").addImport("com.google.gson.annotations.Since");
* mobileDataFiles.setTableName("MS_MOBILEDATAFILES");
* mobileDataFiles.addLongProperty("id_datafile").notNull().primaryKey();
* mobileDataFiles.addStringProperty("is_active");
* mobileDataFiles.addDateProperty("max_timestamp");
* mobileDataFiles.addStringProperty("file_url");
* mobileDataFiles.addStringProperty("alternate_file_url");
* mobileDataFiles.addStringProperty("hash_sha1");
* mobileDataFiles.addStringProperty("usr_crt");
* mobileDataFiles.addDateProperty("dtm_crt");
* mobileDataFiles.addStringProperty("usr_upd");
* mobileDataFiles.addDateProperty("dtm_upd");
* mobileDataFiles.addStringProperty("downloaded_file_path");
* mobileDataFiles.addBooleanProperty("import_flag");
* <p>
* ubah isi class object mobiledatafile menjadi seperti berikut:
* public class mobiledatafile {
*
* @SerializedName("idDatafile") private long id_datafile;
* @SerializedName("isActive") private String is_active;
* @SerializedName("maxTimestamp") private java.util.Date max_timestamp;
* @SerializedName("fileUrl") private String file_url;
* @SerializedName("alternateFileUrl") private String alternate_file_url;
* @SerializedName("hashSha1") private String hash_sha1;
* @SerializedName("usrCrt") private String usr_crt;
* @SerializedName("dtmCrt") private java.util.Date dtm_crt;
* @SerializedName("usrUpd") private String usr_upd;
* @SerializedName("dtmUpd") private java.util.Date dtm_upd;
* private transient String downloaded_file_path;
* private transient Boolean import_flag;
* <p>
* public mobiledatafile() {
* }
* <p>
* public mobiledatafile(long id_datafile) {
* this.id_datafile = id_datafile;
* }
* <p>
* public mobiledatafile(long id_datafile, String is_active, java.util.Date max_timestamp, String file_url, String alternate_file_url, String hash_sha1, String usr_crt, java.util.Date dtm_crt, String usr_upd, java.util.Date dtm_upd, String downloaded_file_path, Boolean import_flag) {
* this.id_datafile = id_datafile;
* this.is_active = is_active;
* this.max_timestamp = max_timestamp;
* this.file_url = file_url;
* this.alternate_file_url = alternate_file_url;
* this.hash_sha1 = hash_sha1;
* this.usr_crt = usr_crt;
* this.dtm_crt = dtm_crt;
* this.usr_upd = usr_upd;
* this.dtm_upd = dtm_upd;
* this.downloaded_file_path = downloaded_file_path;
* this.import_flag = import_flag;
* }
* <p>
* public long getId_datafile() {
* return id_datafile;
* }
* <p>
* public void setId_datafile(long id_datafile) {
* this.id_datafile = id_datafile;
* }
* <p>
* public String getIs_active() {
* return is_active;
* }
* <p>
* public void setIs_active(String is_active) {
* this.is_active = is_active;
* }
* <p>
* public java.util.Date getMax_timestamp() {
* return max_timestamp;
* }
* <p>
* public void setMax_timestamp(java.util.Date max_timestamp) {
* this.max_timestamp = max_timestamp;
* }
* <p>
* public String getFile_url() {
* return file_url;
* }
* <p>
* public void setFile_url(String file_url) {
* this.file_url = file_url;
* }
* <p>
* public String getAlternate_file_url() {
* return alternate_file_url;
* }
* <p>
* public void setAlternate_file_url(String alternate_file_url) {
* this.alternate_file_url = alternate_file_url;
* }
* <p>
* public String getHash_sha1() {
* return hash_sha1;
* }
* <p>
* public void setHash_sha1(String hash_sha1) {
* this.hash_sha1 = hash_sha1;
* }
* <p>
* public String getUsr_crt() {
* return usr_crt;
* }
* <p>
* public void setUsr_crt(String usr_crt) {
* this.usr_crt = usr_crt;
* }
* <p>
* public java.util.Date getDtm_crt() {
* return dtm_crt;
* }
* <p>
* public void setDtm_crt(java.util.Date dtm_crt) {
* this.dtm_crt = dtm_crt;
* }
* <p>
* public String getUsr_upd() {
* return usr_upd;
* }
* <p>
* public void setUsr_upd(String usr_upd) {
* this.usr_upd = usr_upd;
* }
* <p>
* public java.util.Date getDtm_upd() {
* return dtm_upd;
* }
* <p>
* public void setDtm_upd(java.util.Date dtm_upd) {
* this.dtm_upd = dtm_upd;
* }
* <p>
* public String getDownloaded_file_path() {
* return downloaded_file_path;
* }
* <p>
* public void setDownloaded_file_path(String downloaded_file_path) {
* this.downloaded_file_path = downloaded_file_path;
* }
* <p>
* public Boolean getImport_flag() {
* return import_flag;
* }
* <p>
* public void setImport_flag(Boolean import_flag) {
* this.import_flag = import_flag;
* }
* <p>
* }
*/
/**
* Tambahkan code berikut di mssdaogenerator dan generate database baru.
* INGAT : setiap kali ada perubahan db harus ditimpa ulang dengan isi berikut karena file akan tergenerate ulang oleh DAOgenerator
* //MS_MOBILEDATAFILES
Entity mobileDataFiles = schema.addEntity("mobiledatafile").addImport("com.google.gson.annotations.Since");
mobileDataFiles.setTableName("MS_MOBILEDATAFILES");
mobileDataFiles.addLongProperty("id_datafile").notNull().primaryKey();
mobileDataFiles.addStringProperty("is_active");
mobileDataFiles.addDateProperty("max_timestamp");
mobileDataFiles.addStringProperty("file_url");
mobileDataFiles.addStringProperty("alternate_file_url");
mobileDataFiles.addStringProperty("hash_sha1");
mobileDataFiles.addStringProperty("usr_crt");
mobileDataFiles.addDateProperty("dtm_crt");
mobileDataFiles.addStringProperty("usr_upd");
mobileDataFiles.addDateProperty("dtm_upd");
mobileDataFiles.addStringProperty("downloaded_file_path");
mobileDataFiles.addBooleanProperty("import_flag");
*/
/**
* ubah isi class object mobiledatafile menjadi seperti berikut:
public class mobiledatafile {
@SerializedName("idDatafile") private long id_datafile;
@SerializedName("isActive") private String is_active;
@SerializedName("maxTimestamp") private java.util.Date max_timestamp;
@SerializedName("fileUrl") private String file_url;
@SerializedName("alternateFileUrl") private String alternate_file_url;
@SerializedName("hashSha1") private String hash_sha1;
@SerializedName("usrCrt") private String usr_crt;
@SerializedName("dtmCrt") private java.util.Date dtm_crt;
@SerializedName("usrUpd") private String usr_upd;
@SerializedName("dtmUpd") private java.util.Date dtm_upd;
private transient String downloaded_file_path;
private transient Boolean import_flag;
public mobiledatafile() {
}
public mobiledatafile(long id_datafile) {
this.id_datafile = id_datafile;
}
public mobiledatafile(long id_datafile, String is_active, java.util.Date max_timestamp, String file_url, String alternate_file_url, String hash_sha1, String usr_crt, java.util.Date dtm_crt, String usr_upd, java.util.Date dtm_upd, String downloaded_file_path, Boolean import_flag) {
this.id_datafile = id_datafile;
this.is_active = is_active;
this.max_timestamp = max_timestamp;
this.file_url = file_url;
this.alternate_file_url = alternate_file_url;
this.hash_sha1 = hash_sha1;
this.usr_crt = usr_crt;
this.dtm_crt = dtm_crt;
this.usr_upd = usr_upd;
this.dtm_upd = dtm_upd;
this.downloaded_file_path = downloaded_file_path;
this.import_flag = import_flag;
}
public long getId_datafile() {
return id_datafile;
}
public void setId_datafile(long id_datafile) {
this.id_datafile = id_datafile;
}
public String getIs_active() {
return is_active;
}
public void setIs_active(String is_active) {
this.is_active = is_active;
}
public java.util.Date getMax_timestamp() {
return max_timestamp;
}
public void setMax_timestamp(java.util.Date max_timestamp) {
this.max_timestamp = max_timestamp;
}
public String getFile_url() {
return file_url;
}
public void setFile_url(String file_url) {
this.file_url = file_url;
}
public String getAlternate_file_url() {
return alternate_file_url;
}
public void setAlternate_file_url(String alternate_file_url) {
this.alternate_file_url = alternate_file_url;
}
public String getHash_sha1() {
return hash_sha1;
}
public void setHash_sha1(String hash_sha1) {
this.hash_sha1 = hash_sha1;
}
public String getUsr_crt() {
return usr_crt;
}
public void setUsr_crt(String usr_crt) {
this.usr_crt = usr_crt;
}
public java.util.Date getDtm_crt() {
return dtm_crt;
}
public void setDtm_crt(java.util.Date dtm_crt) {
this.dtm_crt = dtm_crt;
}
public String getUsr_upd() {
return usr_upd;
}
public void setUsr_upd(String usr_upd) {
this.usr_upd = usr_upd;
}
public java.util.Date getDtm_upd() {
return dtm_upd;
}
public void setDtm_upd(java.util.Date dtm_upd) {
this.dtm_upd = dtm_upd;
}
public String getDownloaded_file_path() {
return downloaded_file_path;
}
public void setDownloaded_file_path(String downloaded_file_path) {
this.downloaded_file_path = downloaded_file_path;
}
public Boolean getImport_flag() {
return import_flag;
}
public void setImport_flag(Boolean import_flag) {
this.import_flag = import_flag;
}
}
*/
/**
* class containing methods to access local database
*/
public class MobileDataFileDataAccess {
// private static DaoOpenHelper daoOpenHelper;
/**
* use to generate dao session that you can access modelDao
*
* @param context --> context from activity
* @return
*/
protected static DaoSession getDaoSession(Context context) {
/*if(daoOpenHelper==null){
// if(daoOpenHelper.getDaoSession()==null)
daoOpenHelper = new DaoOpenHelper(context);
}
DaoSession daoSeesion = daoOpenHelper.getDaoSession();
return daoSeesion;*/
return DaoOpenHelper.getDaoSession(context);
}
protected static MobileDataFileDao getMobileDataFileDao(Context context) {
return getDaoSession(context).getMobileDataFileDao();
}
public static void closeAll() {
/*if(daoOpenHelper!=null){
daoOpenHelper.closeAll();
daoOpenHelper = null;
}*/
DaoOpenHelper.closeAll();
}
/**
* insert or replace record
* @param context
* @param mobileDataFile
*/
public static void addOrReplace(Context context, MobileDataFile mobileDataFile) {
if (getOne(context, mobileDataFile.getId_datafile()) == null) {
add(context, mobileDataFile);
} else {
update(context, mobileDataFile);
}
}
/**
* bulk insert list
* @param context
* @param mobileDataFileList
*/
public static void addOrReplace(Context context, List<MobileDataFile> mobileDataFileList) {
for (MobileDataFile mdf : mobileDataFileList)
if (getOne(context, mdf.getId_datafile()) == null)
add(context, mdf);
else update(context, mdf);
}
/**
* insert single row
*
* @param context
* @param mobileDataFile
*
*
*/
public static void add(Context context, MobileDataFile mobileDataFile) {
getMobileDataFileDao(context).insert(mobileDataFile);
}
/**
* bulk insert
*
* @param context
* @param mobileDataFileList
*/
public static void add(Context context, List<MobileDataFile> mobileDataFileList) {
getMobileDataFileDao(context).insertInTx(mobileDataFileList);
}
/**
*
* delete all content in table.
*
* @param context
*/
public static void clean(Context context) {
getMobileDataFileDao(context).deleteAll();
}
/**
* @param context
* @param mobileDataFile
*/
public static void delete(Context context, MobileDataFile mobileDataFile) {
getMobileDataFileDao(context).delete(mobileDataFile);
}
/**
* @param context
* @param mobileDataFile
*/
public static void update(Context context, MobileDataFile mobileDataFile) {
getMobileDataFileDao(context).update(mobileDataFile);
}
/**
* get one mobileDataFile
*
* @param context
* @param keymobiledatafile
* @return
*/
public static MobileDataFile getOne(Context context, long keymobiledatafile) {
QueryBuilder<MobileDataFile> qb = getMobileDataFileDao(context).queryBuilder();
qb.where(MobileDataFileDao.Properties.Id_datafile.eq(keymobiledatafile));
qb.build();
if (qb.list().size() > 0)
return qb.list().get(0);
else return null;
}
/**
* select * from table where id_datafile = param
*
* @param context
* @param idDataFile
* @return
*/
public static List<MobileDataFile> getAll(Context context, long idDataFile) {
QueryBuilder<MobileDataFile> qb = getMobileDataFileDao(context).queryBuilder();
qb.where(MobileDataFileDao.Properties.Id_datafile.eq(idDataFile));
qb.build();
return qb.list();
}
/**
* get list of all active files that need to be imported to local db
* @param context
* @return
*/
public static List<MobileDataFile> getAllActive(Context context) {
QueryBuilder<MobileDataFile> qb = getMobileDataFileDao(context).queryBuilder();
qb.where(MobileDataFileDao.Properties.Is_active.eq("1"), MobileDataFileDao.Properties.Import_flag.eq("TRUE"));
qb.build();
return qb.list();
}
/**
* get highest timestamp
* @param context
* @return
*/
public static Date getMaxTimestamp(Context context) {
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(0);
QueryBuilder<MobileDataFile> qb = getMobileDataFileDao(context).queryBuilder();
qb.orderDesc(MobileDataFileDao.Properties.Max_timestamp);
qb.build();
if (qb.list().size() > 0)
return qb.list().get(0).getMax_timestamp();
else return cal.getTime();
}
}

View file

@ -0,0 +1,275 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<androidx.cardview.widget.CardView
android:id="@+id/card_view"
android:layout_margin="4dp"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:cardCornerRadius="8dp">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/header">
<LinearLayout
android:layout_width="match_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/logoKompetisi"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/icon_dashboard"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_marginLeft="16dp"
android:textStyle="bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/namaKompetisi"
android:text="Sample Nama Kompetisi"/>
<TextView
android:layout_marginLeft="16dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/dateEvent"
android:text="1 Jan 2020 - 18 Agu 2020 (Sample)"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/body"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:orientation="vertical">
<TextView
android:id="@+id/labelPoinSaya"
android:text="Poin Saya (29 April 2020)"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:textStyle="bold"
android:textAppearance="?attr/textAppearanceListItem" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="80dp">
<LinearLayout
android:layout_weight="1.5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/poinPeriod"
android:text="280"
android:textSize="25sp"
android:layout_marginTop="15dp"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?attr/textAppearanceListItem" />
<TextView
android:id="@+id/updownGracePoin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:text="-24"
android:textColor="#FF0000" />
</LinearLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<TextView
android:id="@+id/angka1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="28000"
android:textAppearance="?attr/textAppearanceListItem" />
<ImageView
android:id="@+id/calenderAll"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="@+id/angka1"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="@drawable/calendar_avgperiod" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/calenderAll"
android:layout_centerInParent="true"
android:orientation="horizontal">
<ImageView
android:id="@+id/updownallcalender"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_gravity="center"
android:src="@drawable/arrowupgreen" />
<TextView
android:id="@+id/updatePointMonth"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="2"
android:textSize="10dp" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent">
<TextView
android:id="@+id/angka2"
android:text="8"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?attr/textAppearanceListItem" />
<ImageView
android:id="@+id/calender8"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginTop="3dp"
android:src="@drawable/calendar_avgmonth2"
android:layout_centerHorizontal="true"
android:layout_below="@+id/angka2"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_marginTop="2dp"
android:layout_below="@+id/calender8"
android:orientation="horizontal">
<ImageView
android:layout_width="12dp"
android:layout_centerVertical="true"
android:layout_height="12dp"
android:src="@drawable/arrowdownred"
android:id="@+id/updownallcalender2"
android:layout_gravity="center" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10dp"
android:text="2"
android:id="@+id/updatePointRata"
/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent">
<TextView
android:id="@+id/angka3"
android:text="21"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?attr/textAppearanceListItem" />
<ImageView
android:layout_width="30dp"
android:layout_centerHorizontal="true"
android:layout_height="30dp"
android:src="@drawable/calendar_avgdayly2"
android:layout_below="@+id/angka3"/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/footer">
<TextView
android:text="Peringkat Saya"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginLeft="16dp"
android:layout_marginBottom="16dp"
android:textAppearance="?attr/textAppearanceListItem" />
<GridView
android:id="@+id/gridview"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:columnWidth="80dp"
android:numColumns="4"
android:verticalSpacing="24dp"
android:horizontalSpacing="10dp"
android:stretchMode="spacingWidthUniform"
/>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>