mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-07-01 05:14:17 +00:00
add project adins
This commit is contained in:
parent
ad06ac5505
commit
f8f85d679d
5299 changed files with 625430 additions and 0 deletions
Binary file not shown.
After Width: | Height: | Size: 758 B |
|
@ -0,0 +1,66 @@
|
|||
package org.acra.log;
|
||||
|
||||
/**
|
||||
* Stub implementation of {@link org.acra.log.ACRALog}, quenches all logging.
|
||||
*/
|
||||
public class HollowLog implements ACRALog {
|
||||
@Override
|
||||
public int v(String tag, String msg) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int v(String tag, String msg, Throwable tr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int d(String tag, String msg) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int d(String tag, String msg, Throwable tr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int i(String tag, String msg) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int i(String tag, String msg, Throwable tr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int w(String tag, String msg) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int w(String tag, String msg, Throwable tr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int w(String tag, Throwable tr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int e(String tag, String msg) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int e(String tag, String msg, Throwable tr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStackTraceString(Throwable tr) {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.adins.mss.foundation.sync.api.model;
|
||||
|
||||
import com.adins.mss.foundation.http.MssResponseType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by adityapurwa on 11/03/15.
|
||||
*/
|
||||
public class SynchronizeResponse<T> extends MssResponseType {
|
||||
@SerializedName("listSync")
|
||||
private List<T> listSync;
|
||||
|
||||
public List<T> getListSync() {
|
||||
return listSync;
|
||||
}
|
||||
|
||||
public void setListSync(List<T> listSync) {
|
||||
this.listSync = listSync;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,182 @@
|
|||
package com.adins.mss.foundation.db.dataaccess;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.adins.mss.dao.DaoSession;
|
||||
import com.adins.mss.dao.PrintDate;
|
||||
import com.adins.mss.dao.PrintDateDao;
|
||||
import com.adins.mss.foundation.db.DaoOpenHelper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import de.greenrobot.dao.query.DeleteQuery;
|
||||
import de.greenrobot.dao.query.QueryBuilder;
|
||||
import de.greenrobot.dao.query.WhereCondition;
|
||||
|
||||
/**
|
||||
* Created by gigin.ginanjar on 03/10/2016.
|
||||
*/
|
||||
|
||||
public class PrintDateDataAccess {
|
||||
/**
|
||||
* use to generate dao session that you can access modelDao
|
||||
*
|
||||
* @param context --> context from activity
|
||||
* @return
|
||||
*/
|
||||
protected static DaoSession getDaoSession(Context context) {
|
||||
|
||||
return DaoOpenHelper.getDaoSession(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* get PrintDate dao and you can access the DB
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
protected static PrintDateDao getPrintDateDao(Context context) {
|
||||
return getDaoSession(context).getPrintDateDao();
|
||||
}
|
||||
|
||||
public static void closeAll() {
|
||||
DaoOpenHelper.closeAll();
|
||||
}
|
||||
|
||||
public static void add(Context context, PrintDate printDate) {
|
||||
getPrintDateDao(context).insertInTx(printDate);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* add PrintDate as list entity
|
||||
*
|
||||
* @param context
|
||||
* @param printDateList
|
||||
*/
|
||||
public static void add(Context context, List<PrintDate> printDateList) {
|
||||
getPrintDateDao(context).insertInTx(printDateList);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* addOrReplace PrintDate as entity
|
||||
*
|
||||
* @param context
|
||||
* @param printDate
|
||||
*/
|
||||
public static void addOrReplace(Context context, PrintDate printDate) {
|
||||
getPrintDateDao(context).insertOrReplaceInTx(printDate);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* addOrReplace PrintDate as list entity
|
||||
*
|
||||
* @param context
|
||||
* @param printDateList
|
||||
*/
|
||||
public static void addOrReplace(Context context, List<PrintDate> printDateList) {
|
||||
getPrintDateDao(context).insertOrReplaceInTx(printDateList);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* delete all content in table.
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
public static void clean(Context context) {
|
||||
getPrintDateDao(context).deleteAll();
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PrintDate
|
||||
* @param context
|
||||
*/
|
||||
public static void delete(Context context, PrintDate PrintDate) {
|
||||
getPrintDateDao(context).delete(PrintDate);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* delete all record by keyScheme
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
public static void delete(Context context, String uuid_task_h) {
|
||||
QueryBuilder<PrintDate> qb = getPrintDateDao(context).queryBuilder();
|
||||
qb.where(PrintDateDao.Properties.Uuid_task_h.eq(uuid_task_h));
|
||||
qb.build();
|
||||
getPrintDateDao(context).deleteInTx(qb.list());
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
public static void delete(Context context, long dtm_crt) {
|
||||
DeleteQuery<PrintDate> dq = getPrintDateDao(context).queryBuilder()
|
||||
.where(PrintDateDao.Properties.Dtm_print.eq(dtm_crt))
|
||||
.buildDelete();
|
||||
dq.executeDeleteWithoutDetachingEntities();
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PrintDate
|
||||
* @param context
|
||||
*/
|
||||
public static void update(Context context, PrintDate PrintDate) {
|
||||
getPrintDateDao(context).update(PrintDate);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* select * from table where uuid_scheme = param
|
||||
*
|
||||
* @param context
|
||||
* @param uuid_task_h
|
||||
* @return
|
||||
*/
|
||||
public static List<PrintDate> getAll(Context context, String uuid_task_h) {
|
||||
QueryBuilder<PrintDate> qb = getPrintDateDao(context).queryBuilder();
|
||||
qb.where(PrintDateDao.Properties.Uuid_task_h.eq(uuid_task_h));
|
||||
qb.build();
|
||||
return qb.list();
|
||||
}
|
||||
|
||||
public static List<PrintDate> getAll(Context context) {
|
||||
QueryBuilder<PrintDate> qb = getPrintDateDao(context).queryBuilder();
|
||||
qb.where( new WhereCondition.StringCondition //2018-12-17 : Nendi - Exclude Revisit
|
||||
("UUID_TASK_H NOT IN " +
|
||||
"(SELECT UUID_TASK_H FROM TR_TASK_H WHERE TR_TASK_H.UUID_TASK_H != TR_TASK_H.TASK_ID)"));
|
||||
qb.build();
|
||||
return qb.list();
|
||||
}
|
||||
|
||||
/**
|
||||
* select * from table where uuid_print_item = param
|
||||
*
|
||||
* @param context
|
||||
* @param uuid_task_h
|
||||
* @return
|
||||
*/
|
||||
public static PrintDate getOne(Context context, String uuid_task_h) {
|
||||
QueryBuilder<PrintDate> qb = getPrintDateDao(context).queryBuilder();
|
||||
qb.where(PrintDateDao.Properties.Uuid_task_h.eq(uuid_task_h));
|
||||
qb.build();
|
||||
if (qb.list().size() > 0) {
|
||||
return qb.list().get(0);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static PrintDate getOneHeader(Context context, Date dtm_print) {
|
||||
QueryBuilder<PrintDate> qb = getPrintDateDao(context).queryBuilder();
|
||||
qb.where(PrintDateDao.Properties.Dtm_print.eq(dtm_print));
|
||||
qb.build();
|
||||
if (qb.list().size() == 0)
|
||||
return null;
|
||||
return qb.list().get(0);
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
|
@ -0,0 +1,131 @@
|
|||
package com.adins.mss.coll.fragments;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.TableLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.adins.mss.base.GlobalData;
|
||||
import com.adins.mss.base.util.LocaleHelper;
|
||||
import com.adins.mss.coll.R;
|
||||
import com.adins.mss.constant.Global;
|
||||
import com.adins.mss.dao.PaymentHistoryD;
|
||||
import com.adins.mss.foundation.formatter.Formatter;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
|
||||
import org.acra.ACRA;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Created by adityapurwa on 23/03/15.
|
||||
*/
|
||||
public class PaymentHistoryDetailFragment extends AppCompatActivity {
|
||||
public static final String PAYMENT_HISTORY_DETAIL = "PaymentHistoryDetailFragment.PAYMENT_HISTORY_DETAIL";
|
||||
public static final String BUND_KEY_TRANSACTIONCODE= "TRANSACTIONCODE";
|
||||
private FirebaseAnalytics screenName;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
screenName = FirebaseAnalytics.getInstance(this);
|
||||
setContentView(R.layout.new_fragment_payment_history_detail);
|
||||
ACRA.getErrorReporter().putCustomData("LAST_CLASS_ACCESSED", getClass().getSimpleName());
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
toolbar.setTitle(getString(R.string.title_mn_paymenthistorydet));
|
||||
toolbar.setTitleTextColor(getResources().getColor(com.adins.mss.base.R.color.fontColorWhite));
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
List<PaymentHistoryD> details = PaymentHistoryFragment.details;
|
||||
TableLayout table = (TableLayout) findViewById(R.id.tableCollectionDetail);
|
||||
|
||||
TextView transactionCode = (TextView)findViewById(R.id.transactionCode);
|
||||
transactionCode.setText(getIntent().getStringExtra(PaymentHistoryDetailFragment.BUND_KEY_TRANSACTIONCODE));
|
||||
|
||||
for(PaymentHistoryD detail : details) {
|
||||
|
||||
int index = 1;
|
||||
Class<PaymentHistoryD> type = PaymentHistoryD.class;
|
||||
|
||||
for (Method method : type.getMethods()) {
|
||||
if (!method.getName().startsWith("get") || method.getName().equals("getClass")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
View row = LayoutInflater.from(this).inflate(
|
||||
R.layout.view_no_label_value, table, false);
|
||||
TextView no = (TextView) row.findViewById(R.id.no);
|
||||
TextView label = (TextView) row.findViewById(R.id.fieldName);
|
||||
TextView value = (TextView) row.findViewById(R.id.fieldValue);
|
||||
|
||||
String labelField = method.getName().replaceFirst("get", "");
|
||||
|
||||
if (!labelField.equalsIgnoreCase("Dtm_crt")
|
||||
&& !labelField.equalsIgnoreCase("Dtm_upd")
|
||||
&& !labelField.equalsIgnoreCase("Usr_crt")
|
||||
&& !labelField.equalsIgnoreCase("Usr_upd")
|
||||
&& !labelField.equalsIgnoreCase("Uuid_installment_schedule")
|
||||
&& !labelField.equalsIgnoreCase("Uuid_task_h")
|
||||
&& !labelField.equalsIgnoreCase("Uuid_payment_history_h")
|
||||
&& !labelField.equalsIgnoreCase("Uuid_payment_history_d")) {
|
||||
no.setText(String.valueOf(index++));
|
||||
label.setText(labelField.replace("_", " "));
|
||||
try {
|
||||
String stringValue = "";
|
||||
Object itemValue = null;
|
||||
itemValue = method.invoke(detail);
|
||||
if (itemValue == null) {
|
||||
stringValue = "-";
|
||||
} else if (method.getReturnType() == Date.class) {
|
||||
stringValue = Formatter.formatDate((Date) itemValue,
|
||||
Global.DATE_STR_FORMAT);
|
||||
} else {
|
||||
stringValue = String.valueOf(itemValue);
|
||||
}
|
||||
if (stringValue.length() > 3) {
|
||||
String part1 = stringValue.substring(stringValue.length() - 3);
|
||||
if (part1.substring(0, 1).equals(".")) {
|
||||
value.setGravity(Gravity.RIGHT);
|
||||
}
|
||||
}
|
||||
value.setText(stringValue);
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
table.addView(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
//Set Firebase screen name
|
||||
screenName.setCurrentScreen(this, getString(R.string.screen_name_payment_history_detail), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context newBase) {
|
||||
Context context = newBase;
|
||||
Locale locale;
|
||||
try{
|
||||
locale = new Locale(GlobalData.getSharedGlobalData().getLocale());
|
||||
context = LocaleHelper.wrap(newBase, locale);
|
||||
} catch (Exception e) {
|
||||
locale = new Locale(LocaleHelper.ENGLSIH);
|
||||
context = LocaleHelper.wrap(newBase, locale);
|
||||
} finally {
|
||||
super.attachBaseContext(context);
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 3 KiB |
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<scale android:fromXScale="100%p"
|
||||
android:toXScale="80%p"
|
||||
android:fromYScale="100%p"
|
||||
android:toYScale="80%p"
|
||||
android:pivotX="50%p"
|
||||
android:pivotY="50%p"
|
||||
android:duration="@android:integer/config_shortAnimTime" />
|
||||
|
||||
<alpha android:fromAlpha="1"
|
||||
android:toAlpha="0.5"
|
||||
android:duration="@android:integer/config_shortAnimTime"/>
|
||||
|
||||
</set>
|
|
@ -0,0 +1,128 @@
|
|||
package com.adins.mss.foundation.db.dataaccess;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.adins.mss.dao.DaoSession;
|
||||
import com.adins.mss.dao.Theme;
|
||||
import com.adins.mss.dao.ThemeDao;
|
||||
import com.adins.mss.foundation.db.DaoOpenHelper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import de.greenrobot.dao.query.QueryBuilder;
|
||||
|
||||
/**
|
||||
* Created by intishar.fa on 26/09/2018.
|
||||
*/
|
||||
|
||||
public class ThemeDataAccess {
|
||||
|
||||
|
||||
|
||||
protected static DaoSession getDaoSession(Context context) {
|
||||
return DaoOpenHelper.getDaoSession(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* get taskD dao and you can access the DB
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
protected static ThemeDao getThemeDao(Context context) {
|
||||
return getDaoSession(context).getThemeDao();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear session, close db and set daoOpenHelper to null
|
||||
*/
|
||||
public static void closeAll() {
|
||||
/*if(daoOpenHelper!=null){
|
||||
daoOpenHelper.closeAll();
|
||||
daoOpenHelper = null;
|
||||
}*/
|
||||
DaoOpenHelper.closeAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* add taskD as entity
|
||||
*
|
||||
* @param context
|
||||
* @param theme
|
||||
*/
|
||||
public static void add(Context context, Theme theme) {
|
||||
getThemeDao(context).insertInTx(theme);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* add taskD as list entity
|
||||
*
|
||||
* @param context
|
||||
* @param themeList
|
||||
*/
|
||||
public static void add(Context context, List<Theme> themeList) {
|
||||
getThemeDao(context).insertInTx(themeList);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* addOrReplace taskD as entity
|
||||
*
|
||||
* @param context
|
||||
* @param theme
|
||||
*/
|
||||
public static void addOrReplace(Context context, Theme theme) {
|
||||
getThemeDao(context).insertOrReplaceInTx(theme);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* addOrReplace taskD as list entity
|
||||
*
|
||||
* @param context
|
||||
* @param themeList
|
||||
*/
|
||||
public static void addOrReplace(Context context, List<Theme> themeList) {
|
||||
getThemeDao(context).insertOrReplaceInTx(themeList);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* delete all content in table.
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
public static void clean(Context context) {
|
||||
getThemeDao(context).deleteAll();
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param theme
|
||||
*/
|
||||
public static void delete(Context context, Theme theme) {
|
||||
getThemeDao(context).delete(theme);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
public static List<Theme> getAll(Context context){
|
||||
QueryBuilder<Theme> qb = getThemeDao(context).queryBuilder();
|
||||
return qb.list();
|
||||
}
|
||||
|
||||
public static List<Theme> getThemeWithLimit(Context context, int limit){
|
||||
QueryBuilder<Theme> qb = getThemeDao(context).queryBuilder();
|
||||
qb.limit(1);
|
||||
return qb.list();
|
||||
}
|
||||
|
||||
public static List<Theme> getThemeByApplicationType(Context context, String applicationType){
|
||||
QueryBuilder<Theme> qb = getThemeDao(context).queryBuilder();
|
||||
qb.where(ThemeDao.Properties.Application_type.eq(applicationType));
|
||||
return qb.list();
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue