mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-06-30 21:04:16 +00:00
add project adins
This commit is contained in:
parent
ad06ac5505
commit
f8f85d679d
5299 changed files with 625430 additions and 0 deletions
|
@ -0,0 +1,142 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/splashImage"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="0.7"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/header_image" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/loginLayout"
|
||||
android:layout_weight="0.3"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@drawable/bg_grayscale"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible" >
|
||||
|
||||
<include
|
||||
android:id="@+id/include1"
|
||||
layout="@layout/footer" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/relativeLayout2"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/include1"
|
||||
android:padding="5dp" >
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/relativeLayout1"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_marginTop="20dp" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textLoginPrompt"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/editPassword"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginBottom="7dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/login_desc"
|
||||
android:textColor="#001135" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editPassword"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/editUserId"
|
||||
android:layout_marginTop="7dp"
|
||||
android:drawableLeft="@drawable/ms_lock_icon_black"
|
||||
android:ems="10"
|
||||
android:hint="@string/lblLoginPassword"
|
||||
android:inputType="textPassword"
|
||||
android:textColor="@color/tv_darker"
|
||||
android:textColorHint="@color/tv_darker" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editUserId"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/editPassword"
|
||||
android:layout_below="@+id/textLoginPrompt"
|
||||
android:drawableLeft="@drawable/ms_user_icon_black"
|
||||
android:ems="10"
|
||||
android:hint="@string/lblLoginId"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/tv_darker"
|
||||
android:textColorHint="@color/tv_darker" >
|
||||
|
||||
<requestFocus />
|
||||
</EditText>
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/include1"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_below="@+id/checkShowPassword"
|
||||
android:layout_marginTop="15dp"
|
||||
android:padding="5dp"
|
||||
android:weightSum="1" >
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttonLogin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/button_background"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:text="@string/btnLogin"
|
||||
android:textColor="#ffffff"
|
||||
android:visibility="visible" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttonExit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/button_background"
|
||||
android:text="@string/btnExit"
|
||||
android:textColor="#ffffff"/>
|
||||
</LinearLayout>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkShowPassword"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/relativeLayout2"
|
||||
android:layout_marginLeft="@dimen/control_right_margin"
|
||||
android:text="@string/lblShowPassword"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/tv_darker"
|
||||
android:visibility="visible" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkRememberMe"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignRight="@+id/include1"
|
||||
android:layout_below="@+id/relativeLayout2"
|
||||
android:layout_marginRight="@dimen/control_right_margin"
|
||||
android:paddingRight="5dp"
|
||||
android:text="@string/lblRememberMe"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/tv_darker"
|
||||
android:visibility="visible" />
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
Binary file not shown.
After Width: | Height: | Size: 8.8 KiB |
|
@ -0,0 +1,239 @@
|
|||
<?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:id="@+id/dummyTaskListLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dummyTaskItem"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@color/timelineLine"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/dummyTimelineIcon"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginTop="10dp"
|
||||
android:padding="2dp"
|
||||
android:src="@drawable/task_highpriority" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/dummyTaskHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/card_margin"
|
||||
app:cardBackgroundColor="@color/fontColorWhite"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardElevation="@dimen/card_shadow"
|
||||
app:contentPadding="5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dummyTaskLayout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dummyTaskName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@drawable/ic_person_color"
|
||||
android:drawablePadding="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="Sample Name"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dummyTaskAddress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@drawable/ic_location_color"
|
||||
android:drawablePadding="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="Sample Address"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dummyTaskPhone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@drawable/ic_phone_color"
|
||||
android:drawablePadding="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="Sample Phone"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/dummyCollectionInfo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dummyTaskAgreement"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
android:drawableLeft="@drawable/ic_form_color"
|
||||
android:drawablePadding="5dp"
|
||||
android:text="OJK0001"
|
||||
android:textSize="12dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dummyTaskAmount"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
android:drawableLeft="@drawable/ic_cash_color"
|
||||
android:drawablePadding="5dp"
|
||||
android:text="5,000,000.00"
|
||||
android:textSize="12dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dummyTaskOverdue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
android:drawableLeft="@drawable/ic_date_color"
|
||||
android:drawablePadding="5dp"
|
||||
android:text="10 day(s)"
|
||||
android:textSize="12dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dummyTaskInst"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
android:drawableLeft="@drawable/ic_no_color"
|
||||
android:drawablePadding="5dp"
|
||||
android:text="20"
|
||||
android:textSize="12dp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dummyTxtslatime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="@drawable/sla_shape_green"
|
||||
android:drawableLeft="@drawable/ic_sla"
|
||||
android:drawablePadding="5dp"
|
||||
android:padding="5dp"
|
||||
android:text="TOM 11.45"
|
||||
android:textSize="11dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dummyTxtSaveDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_gravity="end"
|
||||
android:drawableLeft="@drawable/ic_save_color"
|
||||
android:drawablePadding="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:text="11.45"
|
||||
android:textSize="11dp"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dummySelectedSequence"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="1" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/dummySelectPlanTaskCB"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/dummyNoData"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/card_margin"
|
||||
android:visibility="gone"
|
||||
app:cardBackgroundColor="@color/fontColorWhite"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardElevation="@dimen/card_shadow"
|
||||
app:contentPadding="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/data_not_found"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
|
@ -0,0 +1,59 @@
|
|||
package com.adins.mss.base.models;
|
||||
|
||||
import com.adins.mss.foundation.http.MssRequestType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class GetDataTableRequest extends MssRequestType {
|
||||
|
||||
@SerializedName("fileName")
|
||||
private String fileName;
|
||||
@SerializedName("appInfo")
|
||||
private String appInfo;
|
||||
@SerializedName("query")
|
||||
private String query;
|
||||
@SerializedName("data")
|
||||
private String data;
|
||||
@SerializedName("user")
|
||||
private String user;
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String getAppInfo() {
|
||||
return appInfo;
|
||||
}
|
||||
|
||||
public void setAppInfo(String appInfo) {
|
||||
this.appInfo = appInfo;
|
||||
}
|
||||
|
||||
public String getQuery() {
|
||||
return query;
|
||||
}
|
||||
|
||||
public void setQuery(String query) {
|
||||
this.query = query;
|
||||
}
|
||||
|
||||
public String getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(String data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public String getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(String user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.adins.mss.svy.models;
|
||||
|
||||
import com.adins.mss.foundation.http.MssRequestType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* Created by olivia.dg on 6/2/2017.
|
||||
*/
|
||||
|
||||
public class JsonRequestUserList extends MssRequestType {
|
||||
/** Property uuid_task_h */
|
||||
@SerializedName("uuid_task_h")
|
||||
public String uuid_task_h;
|
||||
@SerializedName("access_mode")
|
||||
private String access_mode;
|
||||
|
||||
/**
|
||||
* Gets the uuid_task_h
|
||||
*/
|
||||
public String getUuid_task_h() {
|
||||
return this.uuid_task_h;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the uuid_task_h
|
||||
*/
|
||||
public void setUuid_task_h(String value) {
|
||||
this.uuid_task_h = value;
|
||||
}
|
||||
|
||||
public String getAccess_mode() {
|
||||
return this.access_mode;
|
||||
}
|
||||
|
||||
public void setAccess_mode(String value) {
|
||||
this.access_mode = value;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,137 @@
|
|||
package com.adins.mss.foundation.db.dataaccess;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.adins.mss.base.GlobalData;
|
||||
import com.adins.mss.base.todolist.todayplanrepository.TodayPlanRepository;
|
||||
import com.adins.mss.dao.PlanTask;
|
||||
import com.adins.mss.dao.PlanTaskDao;
|
||||
import com.adins.mss.foundation.db.DaoOpenHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import de.greenrobot.dao.query.DeleteQuery;
|
||||
import de.greenrobot.dao.query.QueryBuilder;
|
||||
|
||||
public class PlanTaskDataAccess {
|
||||
|
||||
public static final String STATUS_DRAFTED = "Drafted";
|
||||
public static final String STATUS_PLANNED = "Planned";
|
||||
public static final String STATUS_STARTED = "Started";
|
||||
public static final String STATUS_FINISH = "Finish";
|
||||
|
||||
private static PlanTaskDao getPlanTaskDao(Context context){
|
||||
return DaoOpenHelper.getDaoSession(context).getPlanTaskDao();
|
||||
}
|
||||
|
||||
public static void addPlan(Context context,PlanTask planTask){
|
||||
QueryBuilder qb = getPlanTaskDao(context).queryBuilder();
|
||||
qb.where(PlanTaskDao.Properties.Uuid_task_h.eq(planTask));
|
||||
int samePlanTask = qb.list().size();
|
||||
if(samePlanTask == 0){
|
||||
getPlanTaskDao(context).insert(planTask);
|
||||
}
|
||||
}
|
||||
|
||||
public static void updatePlan(Context context,PlanTask planTask){
|
||||
QueryBuilder qb = getPlanTaskDao(context).queryBuilder();
|
||||
qb.where(PlanTaskDao.Properties.Uuid_plan_task.eq(planTask.getUuid_plan_task()));
|
||||
int samePlanTask = qb.list().size();
|
||||
if(samePlanTask > 0){
|
||||
getPlanTaskDao(context).update(planTask);
|
||||
}
|
||||
}
|
||||
|
||||
public static void addUpdatePlans(Context context, List<PlanTask> planTasks){
|
||||
getPlanTaskDao(context).insertOrReplaceInTx(planTasks);
|
||||
}
|
||||
|
||||
public static void removePlan(Context context,PlanTask planTask){
|
||||
getPlanTaskDao(context).delete(planTask);
|
||||
}
|
||||
|
||||
public static void removeAllPlans(Context context,String uuidUser){
|
||||
QueryBuilder<PlanTask> deleteQuery = getPlanTaskDao(context).queryBuilder();
|
||||
deleteQuery.where(PlanTaskDao.Properties.Uuid_user.eq(uuidUser)).buildDelete().executeDeleteWithoutDetachingEntities();
|
||||
}
|
||||
|
||||
public static int totalAllPlanFromStart(Context context,String uuidUser){
|
||||
QueryBuilder qb = getPlanTaskDao(context).queryBuilder();
|
||||
qb.where(PlanTaskDao.Properties.Uuid_user.eq(uuidUser));
|
||||
return (int)qb.count();
|
||||
}
|
||||
|
||||
public static int getPlanLastSequenceNo(Context context,String uuidUser){
|
||||
QueryBuilder qb = getPlanTaskDao(context).queryBuilder();
|
||||
qb.where(PlanTaskDao.Properties.Uuid_user.eq(uuidUser)).orderDesc(PlanTaskDao.Properties.Sequence);
|
||||
List<PlanTask> plans = qb.list();
|
||||
if(plans.size() == 0){
|
||||
return 0;
|
||||
}
|
||||
|
||||
return plans.get(0).getSequence();
|
||||
}
|
||||
|
||||
public static List<PlanTask> getAllPlan(Context context,String uuidUser){
|
||||
QueryBuilder qb = getPlanTaskDao(context).queryBuilder();
|
||||
qb.where(PlanTaskDao.Properties.Uuid_user.eq(uuidUser)
|
||||
,PlanTaskDao.Properties.Plan_status.notIn(PlanTaskDataAccess.STATUS_FINISH));
|
||||
qb.orderAsc(PlanTaskDao.Properties.View_sequence);
|
||||
|
||||
//filter only plan that started today
|
||||
List<PlanTask> todayPlans = new ArrayList<>();
|
||||
List<PlanTask> allPlans = qb.list();
|
||||
|
||||
//current date
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
int currDay = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
int diff;
|
||||
int yesterdayPlans = 0;
|
||||
|
||||
for(PlanTask planTask:allPlans){
|
||||
if(planTask.getPlan_start_date() == null){
|
||||
todayPlans.add(planTask);
|
||||
continue;
|
||||
}
|
||||
|
||||
calendar.setTime(planTask.getPlan_start_date());
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
diff = currDay - calendar.get(Calendar.DAY_OF_MONTH);
|
||||
if(diff > 0){
|
||||
yesterdayPlans += 1;
|
||||
removePlan(context,planTask);
|
||||
}
|
||||
else {
|
||||
todayPlans.add(planTask);
|
||||
}
|
||||
}
|
||||
if(yesterdayPlans > 0){
|
||||
//reset shared pref plan task
|
||||
TodayPlanRepository todayPlanRepository = GlobalData.getSharedGlobalData().getTodayPlanRepo();
|
||||
if(todayPlanRepository != null){
|
||||
todayPlanRepository.setNeedSync(false);
|
||||
todayPlanRepository.setLastOffChangePlanInfo(null);
|
||||
}
|
||||
}
|
||||
|
||||
return todayPlans;
|
||||
}
|
||||
|
||||
public static List<PlanTask> findPlanByTaskH(Context context,String uuidTaskh){
|
||||
QueryBuilder qb = getPlanTaskDao(context).queryBuilder();
|
||||
qb.where(PlanTaskDao.Properties.Uuid_task_h.eq(uuidTaskh));
|
||||
qb.limit(1);
|
||||
return qb.list();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,141 @@
|
|||
package com.adins.mss.foundation.print;
|
||||
|
||||
import com.adins.mss.foundation.formatter.Tool;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
public class FontSato {
|
||||
public FontSato() {
|
||||
|
||||
}
|
||||
|
||||
//untuk mendapatkan ukuran 1 character setiap font
|
||||
public static double getFontSize(String character) {
|
||||
|
||||
if ("I".equals(character) || "i".equals(character) || "l".equals(character) || ".".equals(character) || ",".equals(character) || ";".equals(character) || ":".equals(character)) {
|
||||
return 4;
|
||||
} else if ("j".equals(character)) {
|
||||
return 5.01;
|
||||
} else if ("f".equals(character) || "t".equals(character)) {
|
||||
return 6;
|
||||
} else if ("r".equals(character) || "z".equals(character)) {
|
||||
return 6.98;
|
||||
} else if ("F".equals(character) || "L".equals(character)) {
|
||||
return 8;
|
||||
} else if ("b".equals(character) || "h".equals(character) || "k".equals(character) || "n".equals(character) || "p".equals(character)) {
|
||||
return 8.93;
|
||||
} else if ("a".equals(character) || "c".equals(character) || "d".equals(character) || "e".equals(character) || "g".equals(character) || "o".equals(character) || "q".equals(character) || "s".equals(character) || "u".equals(character) || "v".equals(character) || "y".equals(character)) {
|
||||
return 9.03;
|
||||
} else if ("E".equals(character) || "J".equals(character) || "0".equals(character) || "1".equals(character) || "2".equals(character) || "3".equals(character) || "4".equals(character) || "5".equals(character) || "6".equals(character) || "7".equals(character) || "8".equals(character) || "9".equals(character)) {
|
||||
return 9.08;
|
||||
} else if (" ".equals(character)) {
|
||||
return 9.71;
|
||||
} else if ("B".equals(character) || "C".equals(character) || "D".equals(character) || "G".equals(character) || "H".equals(character) || "K".equals(character) || "O".equals(character) || "P".equals(character) || "R".equals(character) || "S".equals(character) || "T".equals(character) || "U".equals(character) || "Z".equals(character) || "/".equals(character)) {
|
||||
return 10.01;
|
||||
} else if ("x".equals(character)) {
|
||||
return 10.03;
|
||||
} else if ("N".equals(character) || "Q".equals(character) || "X".equals(character)) {
|
||||
return 10.97;
|
||||
} else if ("V".equals(character)) {
|
||||
return 11.1;
|
||||
} else if ("A".equals(character) || "Y".equals(character)) {
|
||||
return 12;
|
||||
} else if ("M".equals(character) || "m".equals(character)) {
|
||||
return 13.98;
|
||||
} else if ("w".equals(character)) {
|
||||
return 14.7;
|
||||
} else if ("W".equals(character)) {
|
||||
return 17.86;
|
||||
} else {
|
||||
return 12;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//untuk mendapatkan ukuran 1 baris setiap font
|
||||
public static int getLength(String sentence) {
|
||||
double lenght = 0;
|
||||
|
||||
for (int i = 0; i < sentence.length(); i++) {
|
||||
lenght = lenght + getFontSize(sentence.charAt(i) + "");
|
||||
|
||||
}
|
||||
return (int) lenght;
|
||||
}
|
||||
|
||||
//memotong setiap kalimat jika kepanjangan, dan menjadikan baris berikutnya
|
||||
public static Vector wrap(int lenghtPixel, String text) {
|
||||
|
||||
Vector result = new Vector();
|
||||
String[] arrayToPrint = Tool.split(text, " ");
|
||||
StringBuffer totalChar = new StringBuffer();
|
||||
int lenghtChar = 384;
|
||||
|
||||
if (lenghtPixel > 0) {
|
||||
lenghtChar = lenghtPixel;
|
||||
}
|
||||
|
||||
for (int i = 0; i < arrayToPrint.length; i++) {
|
||||
|
||||
SentencesSato sentencesSato = new SentencesSato();
|
||||
int lenghtSentemce = 0;
|
||||
int lenghtSentemce2 = 0;
|
||||
if (i == 0) { //untuk kata pertama
|
||||
lenghtSentemce = getLength(arrayToPrint[i].trim());
|
||||
if (lenghtSentemce < lenghtChar) {
|
||||
totalChar.append(arrayToPrint[i]);
|
||||
} else {// jika setelah pertama ternyata lebih dari 1 baris
|
||||
|
||||
sentencesSato.setSentence(arrayToPrint[i].trim());
|
||||
sentencesSato.setLenghtSentemce(lenghtChar);
|
||||
result.addElement(sentencesSato);
|
||||
|
||||
totalChar = new StringBuffer();
|
||||
}
|
||||
} else {
|
||||
//10 adalah nilai untuk spasi, karena akan ditambahkan spasi
|
||||
lenghtSentemce = getLength(totalChar.toString()) + 10;
|
||||
lenghtSentemce2 = getLength(arrayToPrint[i].trim());
|
||||
|
||||
if (lenghtSentemce2 >= lenghtChar && totalChar.length() <= 1) {
|
||||
// jika setelah huruf pertama ternyata lebih dari 1 baris
|
||||
sentencesSato.setSentence(arrayToPrint[i].trim());
|
||||
sentencesSato.setLenghtSentemce(lenghtChar);
|
||||
result.addElement(sentencesSato);
|
||||
|
||||
totalChar = new StringBuffer();
|
||||
|
||||
} else {
|
||||
|
||||
if ((lenghtSentemce + lenghtSentemce2) < lenghtChar) {
|
||||
totalChar.append(" " + arrayToPrint[i].trim());
|
||||
|
||||
} else {
|
||||
i--;
|
||||
lenghtSentemce = getLength(totalChar.toString().trim());
|
||||
sentencesSato.setSentence(totalChar.toString().trim());
|
||||
sentencesSato.setLenghtSentemce(lenghtSentemce);
|
||||
result.addElement(sentencesSato);
|
||||
|
||||
|
||||
totalChar = new StringBuffer();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
int lenghtFinish = getLength(totalChar.toString());
|
||||
if (lenghtFinish > 0 && lenghtFinish < lenghtChar) {
|
||||
SentencesSato sentencesSato = new SentencesSato();
|
||||
sentencesSato.setSentence(totalChar.toString().trim());
|
||||
sentencesSato.setLenghtSentemce(getLength(totalChar.toString().trim()));
|
||||
result.addElement(sentencesSato);
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,148 @@
|
|||
package com.adins.mss.base.loyalti.mypointdashboard;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.adins.mss.base.NewMainActivity;
|
||||
import com.adins.mss.base.R;
|
||||
import com.adins.mss.base.loyalti.monthlypointacquisition.MonthlyPointsChartView;
|
||||
import com.adins.mss.base.loyalti.userhelpdummy.DashboardMyPointItemDummyAdapter;
|
||||
import com.adins.mss.constant.Global;
|
||||
import com.adins.mss.foundation.UserHelp.Bean.Dummy.UserHelpViewDummy;
|
||||
import com.adins.mss.foundation.UserHelp.UserHelp;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A fragment representing a list of Items.
|
||||
* <p/>
|
||||
* Activities containing this fragment MUST implement the {@link OnListFragmentInteractionListener}
|
||||
* interface.
|
||||
*/
|
||||
public class DashboardMyPoint extends Fragment {
|
||||
|
||||
private OnListFragmentInteractionListener mListener;
|
||||
RecyclerView recyclerView;
|
||||
DashboardMyPointItemRecyclerViewAdapter adapter;
|
||||
private FirebaseAnalytics screenName;
|
||||
|
||||
public DashboardMyPoint() {
|
||||
/**
|
||||
* Mandatory empty constructor for the fragment manager to instantiate the
|
||||
* fragment (e.g. upon screen orientation changes).
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
screenName = FirebaseAnalytics.getInstance(getActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_my_point_item_list, container, false);
|
||||
recyclerView = view.findViewById(R.id.itemList);
|
||||
getActivity().setTitle(getString(R.string.dashboard_competition_page_title));
|
||||
Global.positionStack.push(1);
|
||||
|
||||
setupDashboardListener();
|
||||
|
||||
adapter = new DashboardMyPointItemRecyclerViewAdapter(mListener, getActivity());
|
||||
|
||||
GetDetailListKompetisi getDetailListKompetisi = new GetDetailListKompetisi(recyclerView, adapter, this.getActivity());
|
||||
getDetailListKompetisi.setClassName(this.getClass().getSimpleName());
|
||||
getDetailListKompetisi.execute();
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
//Set Firebase screen name
|
||||
screenName.setCurrentScreen(getActivity(), getString(R.string.screen_name_my_points), null);
|
||||
}
|
||||
|
||||
private void setupDashboardListener(){
|
||||
mListener = new OnListFragmentInteractionListener() {
|
||||
@Override
|
||||
public void onListFragmentInteraction(Bundle item) {
|
||||
//dummy redirect without data: soon to be changed
|
||||
goToMonthlyPointView(item);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void goToMonthlyPointView(Bundle bundle){
|
||||
MonthlyPointsChartView monthlyPointsChart = new MonthlyPointsChartView();
|
||||
monthlyPointsChart.setArguments(bundle);
|
||||
FragmentTransaction transaction = NewMainActivity.fragmentManager.beginTransaction();
|
||||
transaction.setCustomAnimations(R.anim.activity_open_translate,R.anim.activity_close_scale,R.anim.activity_open_scale,R.anim.activity_close_translate);
|
||||
transaction.replace(R.id.content_frame, monthlyPointsChart);
|
||||
transaction.addToBackStack(null);
|
||||
transaction.commit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
mListener = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
setHasOptionsMenu(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPrepareOptionsMenu(final Menu menu) {
|
||||
super.onPrepareOptionsMenu(menu);
|
||||
if(needShowUserHelp()){
|
||||
menu.findItem(R.id.mnGuide).setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if(item.getItemId() == R.id.mnGuide && !Global.BACKPRESS_RESTRICTION){
|
||||
UserHelp.reloadUserHelp(getActivity(), DashboardMyPoint.class.getSimpleName());
|
||||
if (needShowUserHelp())
|
||||
recyclerView.setAdapter(new DashboardMyPointItemDummyAdapter(this.getActivity(),recyclerView, adapter));
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface must be implemented by activities that contain this
|
||||
* fragment to allow an interaction in this fragment to be communicated
|
||||
* to the activity and potentially other fragments contained in that
|
||||
* activity.
|
||||
* <p/>
|
||||
* See the Android Training lesson <a href=
|
||||
* "http://developer.android.com/training/basics/fragments/communicating.html"
|
||||
* >Communicating with Other Fragments</a> for more information.
|
||||
*/
|
||||
public interface OnListFragmentInteractionListener {
|
||||
void onListFragmentInteraction(Bundle item);
|
||||
}
|
||||
|
||||
private boolean needShowUserHelp() {
|
||||
List<UserHelpViewDummy> userHelpViews = Global.userHelpDummyGuide.get(DashboardMyPoint.class.getSimpleName());
|
||||
return Global.ENABLE_USER_HELP && userHelpViews != null;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
<fragment
|
||||
android:id="@+id/maps"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
class="com.google.android.gms.maps.SupportMapFragment"
|
||||
android:tag="maps" />
|
||||
</LinearLayout>
|
|
@ -0,0 +1,81 @@
|
|||
package com.services;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
|
||||
import com.adins.mss.foundation.security.storepreferences.ObscuredSharedPreferences;
|
||||
import com.adins.mss.svy.R;
|
||||
import com.tracking.LocationTrackingService;
|
||||
|
||||
public class MSLocationTrackingService extends LocationTrackingService {
|
||||
public MSLocationTrackingService() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
NotificationChannel channel = new NotificationChannel(getPackageName(), getString(R.string.app_name), NotificationManager.IMPORTANCE_HIGH);
|
||||
channel.setDescription("App Service Persistent");
|
||||
|
||||
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||
manager.createNotificationChannel(channel);
|
||||
}
|
||||
|
||||
ObscuredSharedPreferences sharedPref = ObscuredSharedPreferences.getPrefs(this,
|
||||
"GlobalData", Context.MODE_PRIVATE);
|
||||
if (sharedPref.contains("HAS_LOGGED")) {
|
||||
Notification notification = new NotificationCompat.Builder(this, getPackageName())
|
||||
.setSmallIcon(R.drawable.icon_notif_new)
|
||||
.setContentTitle(getString(R.string.app_name))
|
||||
.setContentText(getString(R.string.application_is_running))
|
||||
.setVisibility(NotificationCompat.VISIBILITY_PRIVATE)
|
||||
.setOngoing(true)
|
||||
.build();
|
||||
|
||||
startForeground(2043, notification);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
// TODO: Return the communication channel to the service.
|
||||
throw new UnsupportedOperationException("Not yet implemented");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
String manufacture = Build.MANUFACTURER.toLowerCase();
|
||||
ObscuredSharedPreferences sharedPref = ObscuredSharedPreferences.getPrefs(getApplicationContext(),
|
||||
"GlobalData", Context.MODE_PRIVATE);
|
||||
boolean hasLogged = sharedPref.getBoolean("HAS_LOGGED", false);
|
||||
if(hasLogged) {
|
||||
switch (manufacture) {
|
||||
case "oppo":
|
||||
case "vivo":
|
||||
Intent autoRestartService = new Intent("com.adins.intent.action_RESTART_AUTOSEND_LOCATION");
|
||||
sendBroadcast(autoRestartService);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class UserLogoutReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Intent locationTrackingService = new Intent(context, MSLocationTrackingService.class);
|
||||
context.stopService(locationTrackingService);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.adins.mss.coll.interfaces;
|
||||
|
||||
import android.app.Activity;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.adins.mss.base.commons.TaskListener;
|
||||
import com.adins.mss.coll.interfaces.callback.DepositReportCallback;
|
||||
import com.adins.mss.dao.DepositReportD;
|
||||
import com.adins.mss.dao.DepositReportH;
|
||||
import com.adins.mss.dao.TaskD;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by kusnendi.muhamad on 28/07/2017.
|
||||
*/
|
||||
|
||||
public interface DepositReportInterface {
|
||||
public void fillHeader(DepositReportCallback callback);
|
||||
public void fillDetail(DepositReportCallback callback);
|
||||
public void cleanDepositReportH();
|
||||
public void insertPrintItemForDeposit();
|
||||
public void generatePrintResultDepositReport(Activity activity, String cashierName, String total, DepositReportH report);
|
||||
public void getReportsReconcile(DepositReportCallback callback);
|
||||
public DepositReportImpl.SendDepositReportTask sendDepositReport(FragmentActivity activity);
|
||||
public double sumOfItems(List<TaskD> items);
|
||||
public void getDepositReportH(Activity activity, TaskListener listener);
|
||||
public HashMap<DepositReportH, List<DepositReportD>> packListOfBatch(List<DepositReportH> batches);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue