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,467 @@
package com.adins.mss.svy.fragments;
import android.app.AlertDialog;
import android.app.DatePickerDialog;
import android.content.Context;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.Handler;
import androidx.fragment.app.Fragment;
import androidx.appcompat.widget.AppCompatSpinner;
import androidx.cardview.widget.CardView;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.TextView;
import com.adins.mss.base.commons.TaskListener;
import com.adins.mss.base.util.Utility;
import com.adins.mss.foundation.UserHelp.UserHelp;
import com.adins.mss.foundation.dialog.NiftyDialogBuilder;
import com.adins.mss.foundation.formatter.Tool;
import com.adins.mss.foundation.http.KeyValue;
import com.adins.mss.svy.R;
import com.adins.mss.svy.models.SurveyorSearchRequest;
import com.adins.mss.svy.models.SurveyorSearchResponse;
import com.google.firebase.analytics.FirebaseAnalytics;
import java.io.IOException;
import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;
import static com.adins.mss.constant.Global.SHOW_USERHELP_DELAY_DEFAULT;
class DateClickListener implements View.OnClickListener {
private final EditText mTarget;
private final Context mContext;
public DateClickListener(Context context, EditText target) {
mContext = context;
mTarget = target;
}
@Override
public void onClick(View v) {
Calendar cal = Calendar.getInstance();
DatePickerDialog dialog = new DatePickerDialog(mContext, new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
mTarget.setText(dayOfMonth + "/" +Tool.appendZeroForDateTime(monthOfYear, true) + "/" + year);
}
}, cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH));
dialog.show();
}
}
/**
* Created by Aditya Purwa on 1/27/2015.
*/
public class SurveyPerformanceFragment extends Fragment {
ImageButton buttonSelectDate;
EditText editDate;
AppCompatSpinner spinnerCategory;
private EditText editStartDate;
private EditText editEndDate;
private EditText editMonthYear;
private ImageButton buttonSelectStartDate;
private ImageButton buttonSelectEndDate;
private Button buttonSearch;
private int activeSearchMode;
private ListView listResult;
private String[] cbSearchBy;
private CardView layout;
private SurveyActivityInterface iSurveyActivity;
private ImageButton butonMonthYear;
private Calendar calendar;
private int bulan;
private int tahun;
private FirebaseAnalytics screenName;
@Override
public void onAttach(Context context) {
super.onAttach(context);
iSurveyActivity = new SurveyActivityImpl(getContext());
setHasOptionsMenu(true);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
screenName = FirebaseAnalytics.getInstance(getActivity());
return inflater.inflate(R.layout.new_fragment_survey_performance, container, false);
}
@Override
public void onDestroyView() {
super.onDestroyView();
layout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
layout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
}
});
Utility.freeMemory();
}
@Override
public void onResume(){
super.onResume();
//Set Firebase screen name
screenName.setCurrentScreen(getActivity(), getString(R.string.screen_name_survey_performance), null);
// olivia : set toolbar
getActivity().findViewById(com.adins.mss.base.R.id.search).setVisibility(View.GONE);
getActivity().findViewById(com.adins.mss.base.R.id.spinner).setVisibility(View.GONE);
getActivity().setTitle(getString(com.adins.mss.base.R.string.title_mn_surveyperformance));
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
// Init
calendar = Calendar.getInstance();
bulan = 0; // Antisipasi null
tahun = 0; // Antisipasi null
listResult = (ListView) view.findViewById(R.id.resultListView);
layout = (CardView) view.findViewById(R.id.resultLayout);
buttonSelectDate = (ImageButton) view.findViewById(R.id.btnDate);
buttonSelectStartDate = (ImageButton) view.findViewById(R.id.btnStartDate);
buttonSelectEndDate = (ImageButton) view.findViewById(R.id.btnEndDate);
buttonSearch = (Button) view.findViewById(R.id.btnSearchOrder);
butonMonthYear = view.findViewById(R.id.btnMonthYear);
editDate = (EditText) view.findViewById(R.id.txtDateDay);
editStartDate = (EditText) view.findViewById(R.id.txtStartDate);
editEndDate = (EditText) view.findViewById(R.id.txtEndDate);
editMonthYear = view.findViewById(R.id.txtDateAndYear);
spinnerCategory = (AppCompatSpinner) view.findViewById(R.id.cbSearchBy);
cbSearchBy = this.getResources().getStringArray(R.array.cbSearchBy);
ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>(getActivity(), R.layout.spinner_search_layout, R.id.text_spin, getResources().getStringArray(R.array.cbSearchBy));
adapter.setDropDownViewResource(R.layout.spinner_style);
spinnerCategory.setAdapter(adapter);
spinnerCategory.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
invalidateForm(position);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
//Nothing selected
}
});
// Inisiasi awal
final String[] months = getActivity().getResources().getStringArray(R.array.cbSearchByMonth);
final DatePickerDialog datePickerDialog = new DatePickerDialog(getActivity(), AlertDialog.THEME_HOLO_LIGHT,
new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
bulan = month;
tahun = year;
String data = months[month] + "-" + String.valueOf(year);
editMonthYear.setText(data);
}
}, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH));
datePickerDialog.getDatePicker().findViewById(Resources.getSystem().getIdentifier("day", "id", "android")).setVisibility(View.GONE);
Calendar minMonthYear = Calendar.getInstance();
minMonthYear.set(calendar.get(Calendar.YEAR)-2, 0, 1);
datePickerDialog.getDatePicker().setMaxDate(new Date().getTime());
datePickerDialog.getDatePicker().setMinDate(minMonthYear.getTimeInMillis());
buttonSelectDate.setOnClickListener(new DateClickListener(getActivity(), editDate));
buttonSelectStartDate.setOnClickListener(new DateClickListener(getActivity(), editStartDate));
buttonSelectEndDate.setOnClickListener(new DateClickListener(getActivity(), editEndDate));
butonMonthYear.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
datePickerDialog.show();
}
});
buttonSearch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SurveyorSearchRequest request = new SurveyorSearchRequest();
try {
if (Tool.isInternetconnected(getActivity())) {
iSurveyActivity.executeSearch(listener, request, editDate.getText().toString(), tahun, bulan, // Ambil bulan dan tahun
editStartDate.getText().toString(), editEndDate.getText().toString(), activeSearchMode);
} else {
NiftyDialogBuilder builder = NiftyDialogBuilder.getInstance(getActivity());
builder.withTitle(getString(R.string.info_capital))
.withMessage(getString(R.string.no_internet_connection))
.show();
}
} catch (ParseException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
});
layout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
if (!UserHelp.isActive) {
UserHelp.showAllUserHelp(SurveyPerformanceFragment.this.getActivity(),
SurveyPerformanceFragment.this.getClass().getSimpleName());
}
}
}, SHOW_USERHELP_DELAY_DEFAULT);
}
});
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if(item.getItemId() == R.id.mnGuide){
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
UserHelp.showAllUserHelp(SurveyPerformanceFragment.this.getActivity(),
SurveyPerformanceFragment.this.getClass().getSimpleName());
}
}, SHOW_USERHELP_DELAY_DEFAULT);
layout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
if(!UserHelp.isActive)
UserHelp.showAllUserHelp(SurveyPerformanceFragment.this.getActivity(),
SurveyPerformanceFragment.this.getClass().getSimpleName());
}
});
}
return super.onOptionsItemSelected(item);
}
TaskListener listener = new TaskListener() {
@Override
public void onCompleteTask(Object result) {
SurveyorSearchResponse serverResponse = (SurveyorSearchResponse) result;
updateResult(serverResponse.getListKeyValue());
}
@Override
public void onCancelTask(boolean value) {
//on cancel task
}
@Override
public void onLocalData(Object result) {
//on local data
}
};
private void updateResult(final KeyValue[] result) {
layout.setVisibility(View.VISIBLE);
SurveyPerformanceFragment.this.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
listResult.setAdapter(new SearchResultListAdapter(getActivity(), result));
}
});
}
// private void executeSearch(SurveyorSearchRequest request, final String date, final int month, final String startDate, final String endDate) throws ParseException, IOException {
// new AsyncTask<Void, Void, SurveyorSearchResponse>(){
// final ProgressDialog progress = new ProgressDialog(getActivity());
// String errMessage;
// @Override
// protected void onPreExecute() {
// super.onPreExecute();
// progress.setMessage(getActivity().getString(R.string.contact_server));
// progress.show();
// }
//
// @Override
// protected SurveyorSearchResponse doInBackground(Void... params) {
// try {
// SurveyorSearchRequest searchRequest = new SurveyorSearchRequest();
// searchRequest.setAudit(GlobalData.getSharedGlobalData().getAuditData());
//
// try {
// if (activeSearchMode == 0) {
// SimpleDateFormat f = new SimpleDateFormat(Global.DATE_STR_FORMAT);
// Date date1 = f.parse(date);
// searchRequest.setDate1(date1);
// }
// if (activeSearchMode == 1) {
// SimpleDateFormat f = new SimpleDateFormat(Global.DATE_STR_FORMAT);
// Date sDate, eDate;
// long sLong = 0;
// long eLong = 0;
// try {
// sDate = f.parse(startDate);
// searchRequest.setDate1(sDate);
// eDate = f.parse(endDate);
// eDate.setHours(23);
// eDate.setMinutes(59);
// eDate.setSeconds(59);
// searchRequest.setDate2(eDate);
// sLong = sDate.getTime();
// eLong = eDate.getTime();
// } catch (ParseException e) {
// errMessage = getActivity().getString(R.string.enter_valid_date);
// return null;
// }
// long milisecond = eLong - sLong;
// if (milisecond > 604799000) {
// errMessage = getActivity().getString(R.string.data_range_not_allowed);
// return null;
// } else if (milisecond < 0) {
// errMessage = getActivity().getString(R.string.input_not_valid);
// return null;
// }
//
// }
// if (activeSearchMode == 2) {
// searchRequest.setMonth(String.valueOf(month + 1));
// }
// } catch (ParseException parseEx) {
// errMessage = getActivity().getString(R.string.enter_valid_date);
// return null;
// }
//
// String json = GsonHelper.toJson(searchRequest);
//
// String url = GlobalData.getSharedGlobalData().getURL_GET_SVYPERFORMANCE();
// boolean encrypt = GlobalData.getSharedGlobalData().isEncrypt();
// boolean decrypt = GlobalData.getSharedGlobalData().isDecrypt();
// HttpCryptedConnection httpConn = new HttpCryptedConnection(getActivity(), encrypt, decrypt);
// HttpConnectionResult serverResult = null;
// try {
// serverResult = httpConn.requestToServer(url, json, Global.DEFAULTCONNECTIONTIMEOUT);
// } catch (Exception e) { FireCrash.log(e);
// e.printStackTrace();
// }
// SurveyorSearchResponse serverResponse = null;
// if (serverResult != null && serverResult.isOK()) {
// try {
// String responseBody = serverResult.getResult();
// serverResponse = GsonHelper.fromJson(responseBody, SurveyorSearchResponse.class);
//
// } catch (Exception e) { FireCrash.log(e);
// if(Global.IS_DEV) {
// e.printStackTrace();
// errMessage=e.getMessage();
// }
// }
// } else {
// errMessage = getActivity().getString(R.string.server_down);
// }
//
// return serverResponse;
// } catch (Exception e) { FireCrash.log(e);
// errMessage = e.getMessage();
// return null;
// }
// }
//
// @Override
// protected void onPostExecute(final SurveyorSearchResponse serverResponse) {
// super.onPostExecute(serverResponse);
// if(getActivity()!=null) {
// if (progress != null && progress.isShowing()) {
// progress.dismiss();
// }
// if (errMessage != null) {
// Toaster.error(getActivity(), errMessage);
// } else if (serverResponse != null && serverResponse.getListKeyValue() != null) {
// layout.setVisibility(View.VISIBLE);
// SurveyPerformanceFragment.this.getActivity().runOnUiThread(new Runnable() {
// @Override
// public void run() {
// listResult.setAdapter(new SearchResultListAdapter(getActivity(), serverResponse.getListKeyValue()));
// }
// });
// }
// }
// }
// }.execute();
// }
private void invalidateForm(int position) {
switch (position) {
case 0:
showSearchForm(R.id.byDay);
break;
case 1:
showSearchForm(R.id.byMonth);
break;
case 2:
showSearchForm(R.id.byEstimatedDate);
break;
default:
break;
}
this.activeSearchMode = position;
}
private void showSearchForm(int id) {
View byDay = getView().findViewById(R.id.byDay);
View byRange = getView().findViewById(R.id.byEstimatedDate);
View byMonth = getView().findViewById(R.id.byMonth);
byDay.setVisibility(View.GONE);
byRange.setVisibility(View.GONE);
byMonth.setVisibility(View.GONE);
View active = getView().findViewById(id);
active.setVisibility(View.VISIBLE);
}
}
class SearchResultListAdapter extends ArrayAdapter<KeyValue> {
public SearchResultListAdapter(Context context) {
super(context, R.layout.view_surveyor_search_result);
}
public SearchResultListAdapter(Context context, KeyValue[] values) {
super(context, R.layout.view_surveyor_search_result, values);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = LayoutInflater.from(getContext()).inflate(R.layout.view_surveyor_search_result, parent, false);
}
TextView label = (TextView) convertView.findViewById(R.id.taskLabel);
TextView value = (TextView) convertView.findViewById(R.id.taskValue);
KeyValue item = getItem(position);
label.setText(item.getKey());
value.setText(item.getValue());
return convertView;
}
}

View file

@ -0,0 +1,176 @@
package com.adins.mss.foundation.db.dataaccess;
import android.content.Context;
import com.adins.mss.dao.DaoSession;
import com.adins.mss.dao.Holiday;
import com.adins.mss.dao.HolidayDao;
import com.adins.mss.foundation.db.DaoOpenHelper;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import de.greenrobot.dao.query.QueryBuilder;
public class HolidayDataAccess {
private HolidayDataAccess() {
}
/**
* 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 Holiday dao and you can access the DB
*
* @param context
* @return
*/
protected static HolidayDao getHolidayDao(Context context) {
return getDaoSession(context).getHolidayDao();
}
/**
* Clear session, close db and set daoOpenHelper to null
*/
public static void closeAll() {
DaoOpenHelper.closeAll();
}
/**
* add holiday as entity
*
* @param context
* @param holiday
*/
public static void add(Context context, Holiday holiday) {
getHolidayDao(context).insert(holiday);
getDaoSession(context).clear();
}
/**
* add holiday as list entity
*
* @param context
* @param listHoliday
*/
public static void add(Context context, List<Holiday> listHoliday) {
getHolidayDao(context).insertInTx(listHoliday);
getDaoSession(context).clear();
}
/**
* delete all content in table.
*
* @param context
*/
public static void clean(Context context) {
getHolidayDao(context).deleteAll();
getDaoSession(context).clear();
}
/**
* @param context
* @param holiday
*/
public static void delete(Context context, Holiday holiday) {
getHolidayDao(context).deleteInTx(holiday);
getDaoSession(context).clear();
}
/**
* @param context
* @param holiday
*/
public static void update(Context context, Holiday holiday) {
getHolidayDao(context).update(holiday);
getDaoSession(context).clear();
}
/**
* add or replace data taskH
*
* @param context
* @param holiday
*/
public static void addOrReplace(Context context, Holiday holiday) {
getHolidayDao(context).insertOrReplaceInTx(holiday);
getDaoSession(context).clear();
}
public static void addOrReplace(Context context, List<Holiday> holiday) {
getHolidayDao(context).insertOrReplaceInTx(holiday);
getDaoSession(context).clear();
}
public static Holiday getOne(Context context, String uuid_holiday) {
QueryBuilder<Holiday> qb = getHolidayDao(context).queryBuilder();
qb.where(HolidayDao.Properties.Uuid_holiday.eq(uuid_holiday));
qb.build();
if (qb.list().isEmpty())
return null;
return qb.list().get(0);
}
public static Holiday getOneByDate(Context context, Date date) {
QueryBuilder<Holiday> qb = getHolidayDao(context).queryBuilder();
qb.where(HolidayDao.Properties.H_date.eq(date));
qb.build();
if (qb.list().isEmpty())
return null;
return qb.list().get(0);
}
public static Holiday getLastUpated(Context context) {
QueryBuilder<Holiday> qb = getHolidayDao(context).queryBuilder();
qb.orderDesc(HolidayDao.Properties.Dtm_upd);
qb.limit(1);
qb.build();
if (qb.list().isEmpty())
return null;
return qb.list().get(0);
}
public static List<Holiday> getAllHolidays(Context context) {
QueryBuilder<Holiday> qb = getHolidayDao(context).queryBuilder();
qb.where(HolidayDao.Properties.Flag_holiday.eq("1"));
qb.build();
if (qb.list().isEmpty())
return Collections.emptyList();
return qb.list();
}
public static Holiday getDay(Context context, Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.MILLISECOND, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.HOUR_OF_DAY, 0);
QueryBuilder<Holiday> qb = getHolidayDao(context).queryBuilder();
qb.where(HolidayDao.Properties.H_date.ge(cal.getTime()));
qb.orderAsc(HolidayDao.Properties.H_date);
qb.limit(1);
qb.build();
if (qb.list().isEmpty())
return null;
return qb.list().get(0);
}
}

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<!-- background -->
<solid android:color="#00ffffff" />
<!-- border -->
<stroke android:width="2dp" android:color="#B22222" />
<!-- corner roundness -->
<corners android:radius="10dp" />
</shape>
</item>
</selector>

View file

@ -0,0 +1,545 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<import type="com.adins.mss.foundation.formatter.Formatter"
alias="fmt" />
<import type="com.adins.mss.constant.Global"
alias="const" />
<variable
name="is_processed"
type="String" />
<variable
name="status"
type="String" />
<variable
name="surveyHeader"
type="com.adins.mss.base.dynamicform.SurveyHeaderBean" />
</data>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/bgColor">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="60dp">
<LinearLayout
android:id="@+id/customer_fragment_form"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="5dp"
app:cardElevation="@dimen/card_shadow"
android:layout_margin="@dimen/card_margin"
android:id="@+id/customerNameLayout">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingRight="5dp"
android:paddingLeft="5dp">
<TextView
android:id="@+id/lblCustomerName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/lblCustomerName"
android:drawableLeft="@drawable/ic_person_color"
android:drawablePadding="5dp"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<EditText
android:id="@+id/txtCustomerName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text=""
android:textColor="@drawable/edit_text_selector"
android:imeOptions="actionNext"
android:inputType="text"
android:maxLength="60"
android:textAppearance="?android:attr/textAppearanceSmall"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="5dp"
app:cardElevation="@dimen/card_shadow"
android:layout_marginLeft="@dimen/card_margin"
android:layout_marginRight="@dimen/card_margin"
android:layout_marginBottom="@dimen/card_margin"
android:id="@+id/customerPhoneLayout">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingRight="5dp"
android:paddingLeft="5dp">
<TextView
android:id="@+id/lblCustomerPhone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/lblCustomerPhone"
android:drawableLeft="@drawable/ic_phone_color"
android:drawablePadding="5dp"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/customerPhoneContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/txtCustomerPhone"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_marginLeft="8dp"
android:imeOptions="actionNext"
android:inputType="number"
android:maxLength="20"
android:text=""
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@drawable/edit_text_selector"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/callPhoneNumber"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_percent="0.8" />
<Button
android:id="@+id/callPhoneNumber"
android:layout_width="50dp"
android:layout_height="25dp"
android:layout_marginTop="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="10dp"
android:background="@drawable/call_button_background"
android:gravity="center"
android:padding="5dp"
android:text="Call"
android:textColor="#ffff"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="5dp"
app:cardElevation="@dimen/card_shadow"
android:layout_marginLeft="@dimen/card_margin"
android:layout_marginRight="@dimen/card_margin"
android:layout_marginBottom="@dimen/card_margin"
android:id="@+id/customerAddressLayout">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingRight="5dp"
android:paddingLeft="5dp">
<TextView
android:id="@+id/lblCustomerAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/lblCustomerAddress"
android:drawableLeft="@drawable/ic_location_color"
android:drawablePadding="5dp"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<EditText
android:id="@+id/txtCustomerAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text=""
android:textColor="@drawable/edit_text_selector"
android:maxLength="120"
android:minLines="2"
android:textAppearance="?android:attr/textAppearanceSmall"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="5dp"
app:cardElevation="@dimen/card_shadow"
android:layout_marginLeft="@dimen/card_margin"
android:layout_marginRight="@dimen/card_margin"
android:layout_marginBottom="@dimen/card_margin"
android:id="@+id/surveyLocationLayout">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingRight="5dp"
android:paddingLeft="5dp">
<TextView
android:id="@+id/txtSurveyLocationTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/survey_location"
android:drawableLeft="@drawable/ic_location_color"
android:drawablePadding="5dp"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<EditText
android:id="@+id/txtSurveyLocation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text=""
android:textColor="@drawable/edit_text_selector"
android:maxLength="120"
android:minLines="2"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="5dp"
app:cardElevation="@dimen/card_shadow"
android:layout_marginLeft="@dimen/card_margin"
android:layout_marginRight="@dimen/card_margin"
android:layout_marginBottom="@dimen/card_margin"
android:id="@+id/customerAgreementLayout"
android:visibility="gone">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingRight="5dp"
android:paddingLeft="5dp">
<TextView
android:id="@+id/lblAgreement"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/lblAgreementNo"
android:drawableLeft="@drawable/ic_cash_color"
android:drawablePadding="5dp"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<EditText
android:id="@+id/txtAgreement"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text=""
android:textColor="@drawable/edit_text_selector"
android:enabled="false"
android:maxLines="1"
android:textAppearance="?android:attr/textAppearanceSmall"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="5dp"
app:cardElevation="@dimen/card_shadow"
android:layout_marginLeft="@dimen/card_margin"
android:layout_marginRight="@dimen/card_margin"
android:layout_marginBottom="@dimen/card_margin"
android:id="@+id/customerOSAmountLayout"
android:visibility="gone">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingRight="5dp"
android:paddingLeft="5dp">
<TextView
android:id="@+id/lblCustomerOSAmount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/lblAmountDue"
android:drawableLeft="@drawable/ic_cash_color"
android:drawablePadding="5dp"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<EditText
android:id="@+id/txtCustomerOSAmount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text=""
android:textColor="@drawable/edit_text_selector"
android:enabled="false"
android:maxLines="1"
android:textAppearance="?android:attr/textAppearanceSmall"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="5dp"
app:cardElevation="@dimen/card_shadow"
android:layout_marginLeft="@dimen/card_margin"
android:layout_marginRight="@dimen/card_margin"
android:layout_marginBottom="@dimen/card_margin"
android:id="@+id/customerODLayout"
android:visibility="gone">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingRight="5dp"
android:paddingLeft="5dp">
<TextView
android:id="@+id/lblCustomerOD"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/lblOverdue"
android:drawableLeft="@drawable/ic_date_color"
android:drawablePadding="5dp"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<EditText
android:id="@+id/txtCustomerOD"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text=""
android:textColor="@drawable/edit_text_selector"
android:maxLines="1"
android:enabled="false"
android:textAppearance="?android:attr/textAppearanceSmall"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="5dp"
app:cardElevation="@dimen/card_shadow"
android:layout_marginLeft="@dimen/card_margin"
android:layout_marginRight="@dimen/card_margin"
android:layout_marginBottom="@dimen/card_margin"
android:id="@+id/customerInstallmentNoLayout"
android:visibility="gone">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingRight="5dp"
android:paddingLeft="5dp">
<TextView
android:id="@+id/lblCustomerInstallmentNo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/lblInstallment"
android:drawableLeft="@drawable/ic_no_color"
android:drawablePadding="5dp"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<EditText
android:id="@+id/txtCustomerInstallmentNo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text=""
android:textColor="@drawable/edit_text_selector"
android:enabled="false"
android:maxLines="1"
android:textAppearance="?android:attr/textAppearanceSmall"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="5dp"
app:cardElevation="@dimen/card_shadow"
android:layout_marginLeft="@dimen/card_margin"
android:layout_marginRight="@dimen/card_margin"
android:layout_marginBottom="@dimen/card_margin"
android:id="@+id/customerNotesLayout">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingRight="5dp"
android:paddingLeft="5dp">
<TextView
android:id="@+id/lblNotes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/lblNotes"
android:drawableLeft="@drawable/ic_form_color"
android:drawablePadding="5dp"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<EditText
android:id="@+id/txtNotes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text=""
android:textColor="@drawable/edit_text_selector"
android:minLines="3"
android:maxLength="2048"
android:textAppearance="?android:attr/textAppearanceSmall"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="5dp"
app:cardElevation="@dimen/card_shadow"
android:layout_marginLeft="@dimen/card_margin"
android:layout_marginRight="@dimen/card_margin"
android:layout_marginBottom="@dimen/card_margin"
android:id="@+id/ptsLayout"
android:visibility="gone">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingRight="5dp"
android:paddingLeft="5dp"
android:id="@+id/ptsDateLayout">
<TextView
android:id="@+id/lblPtsDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/ptsDate"
android:drawableLeft="@drawable/ic_date_color"
android:drawablePadding="5dp"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<TextView
android:id="@+id/txtPtsDate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:text=""
android:textAppearance="?android:attr/textAppearanceSmall"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
<Button
android:id="@+id/btnPts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="@drawable/button_background"
android:text="@string/btnReschedule"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/fontColorWhite"
android:visibility="gone" />
<Button
android:id="@+id/btnReset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="@drawable/button_background"
android:text="@string/btnReset"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/fontColorWhite"/>
<Button
android:id="@+id/btnStartSurvey"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="@drawable/button_background"
android:text="@string/btnStart"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/fontColorWhite" />
<Button
android:id="@+id/btnRevisit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="@drawable/button_background"
android:text="@string/btnRevisit"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/fontColorWhite"
android:visibility="gone" />
<Button
android:id="@+id/btnViewTask"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="@drawable/button_background"
android:text="@string/btnView"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/fontColorWhite"
android:visibility="gone" />
<Button
android:id="@+id/btnPrint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="@drawable/button_background"
android:text="@string/btnPrint"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/fontColorWhite"
android:visibility="gone" />
<Button
android:id="@+id/btnChangePlan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="@drawable/button_background"
android:text="@string/btnChangePlan"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/fontColorWhite"
android:visibility="gone" />
</LinearLayout>
</RelativeLayout>
</layout>

View file

@ -0,0 +1,217 @@
package com.adins.mss.dao;
import java.util.List;
import com.adins.mss.dao.DaoSession;
import de.greenrobot.dao.DaoException;
import com.adins.mss.base.util.ExcludeFromGson;
import com.google.gson.annotations.SerializedName;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit.
/**
* Entity mapped to table "TR_MESSAGE".
*/
public class Message {
/** Not-null value. */
@SerializedName("uuid_message")
private String uuid_message;
@SerializedName("message")
private String message;
@SerializedName("sender_id")
private String sender_id;
@SerializedName("sender_name")
private String sender_name;
@SerializedName("dtm_crt_server")
private java.util.Date dtm_crt_server;
@SerializedName("time_read")
private java.util.Date time_read;
@SerializedName("usr_crt")
private String usr_crt;
@SerializedName("dtm_crt")
private java.util.Date dtm_crt;
@SerializedName("uuid_user")
private String uuid_user;
/** Used to resolve relations */
private transient DaoSession daoSession;
/** Used for active entity operations. */
private transient MessageDao myDao;
private User user;
private String user__resolvedKey;
private List<Timeline> timelineList;
public Message() {
}
public Message(String uuid_message) {
this.uuid_message = uuid_message;
}
public Message(String uuid_message, String message, String sender_id, String sender_name, java.util.Date dtm_crt_server, java.util.Date time_read, String usr_crt, java.util.Date dtm_crt, String uuid_user) {
this.uuid_message = uuid_message;
this.message = message;
this.sender_id = sender_id;
this.sender_name = sender_name;
this.dtm_crt_server = dtm_crt_server;
this.time_read = time_read;
this.usr_crt = usr_crt;
this.dtm_crt = dtm_crt;
this.uuid_user = uuid_user;
}
/** called by internal mechanisms, do not call yourself. */
public void __setDaoSession(DaoSession daoSession) {
this.daoSession = daoSession;
myDao = daoSession != null ? daoSession.getMessageDao() : null;
}
/** Not-null value. */
public String getUuid_message() {
return uuid_message;
}
/** Not-null value; ensure this value is available before it is saved to the database. */
public void setUuid_message(String uuid_message) {
this.uuid_message = uuid_message;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getSender_id() {
return sender_id;
}
public void setSender_id(String sender_id) {
this.sender_id = sender_id;
}
public String getSender_name() {
return sender_name;
}
public void setSender_name(String sender_name) {
this.sender_name = sender_name;
}
public java.util.Date getDtm_crt_server() {
return dtm_crt_server;
}
public void setDtm_crt_server(java.util.Date dtm_crt_server) {
this.dtm_crt_server = dtm_crt_server;
}
public java.util.Date getTime_read() {
return time_read;
}
public void setTime_read(java.util.Date time_read) {
this.time_read = time_read;
}
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 getUuid_user() {
return uuid_user;
}
public void setUuid_user(String uuid_user) {
this.uuid_user = uuid_user;
}
/** To-one relationship, resolved on first access. */
public User getUser() {
String __key = this.uuid_user;
if (user__resolvedKey == null || user__resolvedKey != __key) {
if (daoSession == null) {
throw new DaoException("Entity is detached from DAO context");
}
UserDao targetDao = daoSession.getUserDao();
User userNew = targetDao.load(__key);
synchronized (this) {
user = userNew;
user__resolvedKey = __key;
}
}
return user;
}
public void setUser(User user) {
synchronized (this) {
this.user = user;
uuid_user = user == null ? null : user.getUuid_user();
user__resolvedKey = uuid_user;
}
}
/** To-many relationship, resolved on first access (and after reset). Changes to to-many relations are not persisted, make changes to the target entity. */
public List<Timeline> getTimelineList() {
if (timelineList == null) {
if (daoSession == null) {
throw new DaoException("Entity is detached from DAO context");
}
TimelineDao targetDao = daoSession.getTimelineDao();
List<Timeline> timelineListNew = targetDao._queryMessage_TimelineList(uuid_message);
synchronized (this) {
if(timelineList == null) {
timelineList = timelineListNew;
}
}
}
return timelineList;
}
/** Resets a to-many relationship, making the next get call to query for a fresh result. */
public synchronized void resetTimelineList() {
timelineList = null;
}
/** Convenient call for {@link AbstractDao#delete(Object)}. Entity must attached to an entity context. */
public void delete() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.delete(this);
}
/** Convenient call for {@link AbstractDao#update(Object)}. Entity must attached to an entity context. */
public void update() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.update(this);
}
/** Convenient call for {@link AbstractDao#refresh(Object)}. Entity must attached to an entity context. */
public void refresh() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.refresh(this);
}
}

View file

@ -0,0 +1,34 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layoutView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_grayscale"
>
<View
android:id="@+id/actionbar"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_alignParentTop="true"
android:background="@drawable/actionbar_background" />
<GridView
android:id="@+id/gridLog"
android:layout_below="@+id/actionbar"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:numColumns="3"
android:padding="5dp"
android:horizontalSpacing="4dp"
android:verticalSpacing="4dp">
</GridView>
<ImageButton
android:id="@+id/btnRefresh"
android:visibility="gone"
android:layout_margin="@dimen/padding_large"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_width="64dp"
android:layout_height="64dp"
android:src="@drawable/ic_menu_refresh_white"
android:background="@drawable/button_background_round"/>
</RelativeLayout>

View file

@ -0,0 +1,210 @@
package com.adins.mss.odr.accounts;
import android.content.Context;
import android.location.LocationManager;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.core.content.ContextCompat;
import androidx.viewpager.widget.ViewPager;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.telephony.TelephonyManager;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import com.adins.mss.base.GlobalData;
import com.adins.mss.constant.Global;
import com.adins.mss.dao.Account;
import com.adins.mss.dao.GeneralParameter;
import com.adins.mss.foundation.db.dataaccess.AccountDataAccess;
import com.adins.mss.foundation.db.dataaccess.GeneralParameterDataAccess;
import com.adins.mss.foundation.location.LocationTrackingManager;
import com.adins.mss.foundation.location.UpdateMenuIcon;
import com.adins.mss.odr.R;
import com.github.jjobes.slidedatetimepicker.SlidingTabLayout;
import java.util.ArrayList;
/**
* Created by olivia.dg on 11/17/2017.
*/
public class AccountResultActivity extends AppCompatActivity {
private ViewPager mViewPager;
private ViewPagerAdapter mViewPagerAdapter;
private SlidingTabLayout mSlidingTabLayout;
private Account account;
private ArrayList<String> productContact;
public LocationTrackingManager manager;
public static FragmentManager fragmentManager;
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater menuInflater = getMenuInflater();
menuInflater.inflate(R.menu.main_menu, menu);
mainMenu = menu;
return true;
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
updateMenuIcon(Global.isGPS);
return super.onPrepareOptionsMenu(menu);
}
public static void updateMenuIcon(boolean isGPS) {
UpdateMenuIcon uItem = new UpdateMenuIcon();
uItem.updateGPSIcon(mainMenu);
}
private static Menu mainMenu;
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == com.adins.mss.base.R.id.mnGPS) {
if (Global.LTM != null) {
if (Global.LTM.getIsConnected()) {
Global.LTM.removeLocationListener();
Global.LTM.connectLocationClient();
} else {
StartLocationTracking();
}
Animation a = AnimationUtils.loadAnimation(this, com.adins.mss.base.R.anim.gps_rotate);
findViewById(com.adins.mss.base.R.id.mnGPS).startAnimation(a);
}
}
return super.onOptionsItemSelected(item);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle bundle = getIntent().getExtras();
String uuidAccount = bundle.getString(Global.BUND_KEY_ACCOUNT_ID);
account = AccountDataAccess.getOne(getApplicationContext(), uuidAccount);
productContact = bundle.getStringArrayList(Global.BUND_KEY_PRODUCT_ID);
setContentView(R.layout.account_result_activity);
fragmentManager = getSupportFragmentManager();
setupViews();
initViewPager();
initTabs();
}
@Override
public void onResume() {
super.onResume();
Toolbar toolbar = (Toolbar) findViewById(com.adins.mss.base.R.id.toolbar);
toolbar.setTitle(getString(com.adins.mss.base.R.string.title_mn_account));
toolbar.setTitleTextColor(getResources().getColor(com.adins.mss.base.R.color.fontColorWhite));
setSupportActionBar(toolbar);
}
private void initTabs() {
mSlidingTabLayout.setTabText(0, getResources().getString(R.string.tabDetail));
mSlidingTabLayout.setTabText(1, getResources().getString(R.string.tabContact));
mSlidingTabLayout.setTabText(2, getResources().getString(R.string.tabOppor));
}
private void initViewPager() {
mViewPagerAdapter = new ViewPagerAdapter(getSupportFragmentManager());
mViewPager.setAdapter(mViewPagerAdapter);
mSlidingTabLayout.setCustomTabView(R.layout.custom_tab_tasklist, R.id.tabTextTaskList);
mSlidingTabLayout.setSelectedIndicatorColors(ContextCompat.getColor(this, R.color.tv_white),
ContextCompat.getColor(this, R.color.tv_white));
mSlidingTabLayout.setDividerColors(ContextCompat.getColor(this, R.color.tv_white),
ContextCompat.getColor(this, R.color.tv_white));
mSlidingTabLayout.setViewPager(mViewPager);
}
private void setupViews() {
mViewPager = (ViewPager) findViewById(R.id.pager);
mSlidingTabLayout = (SlidingTabLayout) findViewById(R.id.slidingTabLayout);
mViewPager.setCurrentItem(0, true);
}
private class ViewPagerAdapter extends FragmentPagerAdapter {
public ViewPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
Fragment fragment = null;
switch (position) {
case 0:
fragment = new AccountDetailTabFragment(AccountResultActivity.this, account);
break;
case 1:
fragment = new ContactTabFragment(AccountResultActivity.this, account, productContact);
break;
case 2:
fragment = new OpportunityTabFragment(AccountResultActivity.this, account);
break;
default:
break;
}
return fragment;
}
@Override
public int getCount() {
return 3;
}
}
@Override
public void onBackPressed() {
super.onBackPressed();
}
public void StartLocationTracking() {
try {
LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
GeneralParameter gp_distance = GeneralParameterDataAccess.getOne(getApplicationContext(), GlobalData.getSharedGlobalData().getUser().getUuid_user(), Global.GS_DISTANCE_TRACKING);
try {
if (gp_distance != null) {
int distanceTracking = Integer.parseInt(gp_distance.getGs_value());
if (distanceTracking != 0) {
manager = new LocationTrackingManager(tm, lm, getApplicationContext());
manager.setMinimalDistanceChangeLocation(Integer.parseInt(GeneralParameterDataAccess.getOne(getApplicationContext(), GlobalData.getSharedGlobalData().getUser().getUuid_user(), "PRM13_DIST").getGs_value()));
manager.setMinimalTimeChangeLocation(5);
manager.applyLocationListener(getApplicationContext());
}
}
} catch (Exception e) {
manager = new LocationTrackingManager(tm, lm, getApplicationContext());
manager.setMinimalDistanceChangeLocation(50);
manager.setMinimalTimeChangeLocation(5);
manager.applyLocationListener(getApplicationContext());
}
if (Global.LTM == null) {
Global.LTM = manager;
} else {
try {
Global.LTM = null;
Global.LTM = manager;
} catch (Exception e) {
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/synchronize_activity"
android:background="@drawable/bg_sync_survey">
<include
android:id="@+id/include1"
layout="@layout/footer" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="150dp">
<ImageView
android:id="@+id/ring2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/icon_loading_ring2"/>
<ImageView
android:id="@+id/ring1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/icon_loading_ring" />
<TextView
android:id="@+id/progressLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="0%"
android:textSize="24dp"
android:textColor="@color/fontColorWhite"
android:layout_marginTop="85dp"
android:gravity="center"/>
</RelativeLayout>
<TextView
android:id="@+id/syncLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/synchronizing"
android:textSize="16dp"
android:textColor="@color/fontColorWhite"
android:shadowColor="@color/fontColor"
android:shadowDx="2"
android:shadowDy="2"
android:shadowRadius="5"
android:layout_gravity="center"
android:layout_marginTop="30dp"/>
</LinearLayout>
</RelativeLayout>

View file

@ -0,0 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/bgGridLog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/spinner_background"
android:gravity="center"
android:orientation="vertical"
android:padding="3dp" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="horizontal" >
<TextView
android:id="@+id/txtTaskId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/dummy_task_id"
android:textColor="@color/tv_white"
android:textSize="10dp" />
<ImageView
android:id="@+id/indicatorLamp"
android:layout_width="8dp"
android:layout_height="8dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:src="@drawable/light_red" />
</LinearLayout>
<ImageView
android:id="@+id/logIcon"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_verification_log" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="horizontal"
android:layout_margin="7dp">
<TextView
android:id="@+id/txtName"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:text="@string/customer_name"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/tv_white" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical" >
<TextView
android:id="@+id/txtScheme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minLines="2"
android:text="@string/dummy_form_id"
android:gravity="center_horizontal"
android:textColor="@color/tv_white"
android:textSize="12dp" />
<TextView
android:id="@+id/txtDivider"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/tv_white"
android:text="@string/divider_dash"
android:visibility="gone"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:textSize="8dp" />
<TextView
android:id="@+id/txtTimeSend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/dummy_date_time"
android:textColor="@color/tv_white"
android:textSize="10dp" />
</LinearLayout>
</LinearLayout>

View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<com.adins.mss.foundation.questiongenerator.form.QuestionView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/questionLocationLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/questionLocationLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="0. label" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:weightSum="1">
<Button
android:id="@+id/btnSetLocation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.5"
android:gravity="center"
android:text="@string/btnGPS" />
<ImageView
android:id="@+id/imgLocationAnswer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.5"
android:scaleType="centerInside"
android:src="@drawable/ic_absent" />
</LinearLayout>
<TextView
android:id="@+id/questionLocationAnswer"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.adins.mss.foundation.questiongenerator.form.QuestionView>

View file

@ -0,0 +1,17 @@
package com.services.models;
import com.adins.mss.foundation.http.MssResponseType;
import com.google.gson.annotations.SerializedName;
public class JsonResponseLastSync extends MssResponseType {
@SerializedName("dtm_lastsync")
private String dtm_lastSync;
public String getDtm_lastSync() {
return dtm_lastSync;
}
public void setDtm_lastSync(String dtm_lastSync) {
this.dtm_lastSync = dtm_lastSync;
}
}

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="#2c2d31">
<!-- title -->
<TextView
android:id="@+id/header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="12dp"
android:gravity="center_vertical"
android:textColor="#FFFFFF"
android:text="@string/lblHeader"
android:textStyle="bold"
android:textSize="18dp" />
<!-- divider -->
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="1dp"
android:layout_alignParentBottom="true"
android:background="#DADADA" >
</View>
</RelativeLayout>