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,52 @@
<?xml version="1.0" encoding="utf-8"?>
<com.adins.mss.foundation.questiongenerator.form.QuestionView
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/questionDropdownLayout">
<TextView
android:id="@+id/questionDropdownLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="0. Label"
android:textAppearance="?android:attr/textAppearanceSmall"/>
<TextView
android:id="@+id/questionDropdownEmpty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/lookup_not_found"
android:padding="10dp"
android:textSize="11dp"
android:visibility="gone"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp">
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/spinnerQuestionList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:spinnerMode="dropdown"
android:layout_marginRight="5dp"
android:layout_marginLeft="5dp"
android:background="@drawable/dropdown_background"
android:padding="5dp" />
<ImageView
android:id="@+id/img1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_expand"
android:layout_alignRight="@+id/spinnerQuestionList"
android:layout_alignBottom="@+id/spinnerQuestionList"
android:layout_alignTop="@+id/spinnerQuestionList"
android:layout_marginRight="10dp"
android:tint="@color/gradient_end"/>
</RelativeLayout>
<EditText
android:id="@+id/questionDropdownDescription"
android:layout_width="match_parent"
android:visibility="gone"
android:layout_height="wrap_content" />
</com.adins.mss.foundation.questiongenerator.form.QuestionView>

View file

@ -0,0 +1,398 @@
package com.adins.mss.svy.fragments;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.text.format.DateFormat;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import com.adins.mss.base.GlobalData;
import com.adins.mss.base.NewMainActivity;
import com.adins.mss.base.crashlytics.FireCrash;
import com.adins.mss.base.dynamicform.CustomerFragment;
import com.adins.mss.base.dynamicform.SurveyHeaderBean;
import com.adins.mss.base.tasklog.SurveyTaskAdapter;
import com.adins.mss.base.todolist.form.OnTaskListClickListener;
import com.adins.mss.base.todolist.form.TasklistListener;
import com.adins.mss.base.util.Utility;
import com.adins.mss.constant.Global;
import com.adins.mss.dao.TaskH;
import com.adins.mss.dummy.userhelp_dummy.Adapter.NewTaskLogDummyAdapter;
import com.adins.mss.foundation.db.dataaccess.TaskHDataAccess;
import com.adins.mss.foundation.dialog.NiftyDialogBuilder;
import com.adins.mss.svy.R;
import com.adins.mss.svy.UserHelpSVYDummy;
import com.adins.mss.svy.tool.Constants;
import com.google.firebase.analytics.FirebaseAnalytics;
import org.acra.ACRA;
import java.util.Calendar;
import java.util.List;
public class SurveyVerificationFragment extends Fragment implements OnTaskListClickListener, TasklistListener {
public static TaskH selectedVerified;
private List<TaskH> objects;
private SurveyTaskAdapter adapter;
private RecyclerView recyclerView;
private SwipeRefreshLayout mSwipeRefreshLayout;
private String errMessage = null;
private Context context;
private SurveyActivityInterface iSurveyActivity;
private LinearLayoutManager layoutManager;
private static boolean showDummy = true;
private FirebaseAnalytics screenName;
@Override
public void onAttach(Context activity) {
super.onAttach(activity);
this.context = activity;
iSurveyActivity = new SurveyActivityImpl(context);
setHasOptionsMenu(true);
try {
objects = Constants.listOfVerifiedTask;
if (objects == null || objects.size() == 0) {
objects = TaskHDataAccess.getAllVerifiedForUser(getActivity(), GlobalData.getSharedGlobalData().getUser().getUuid_user());
Constants.listOfVerifiedTask = objects;
}
adapter = new SurveyTaskAdapter(activity, objects, SurveyVerificationFragment.this);
try {
// MSMainMenuActivity.mnSVYVerify.setCounter(String.valueOf(Constants.getCounterVerificationTask(getActivity())));
// if(MainMenuActivity.menuAdapter!=null)
// MainMenuActivity.menuAdapter.notifyDataSetChanged();
// MainMenuActivity.setDrawerCounter();
NewMainActivity.setCounter();
} catch (Exception e) {
FireCrash.log(e);
ACRA.getErrorReporter().putCustomData("ErrorMainMenuActivity", e.getMessage());
ACRA.getErrorReporter().putCustomData("ErrorMainMenuActivity", DateFormat.format("yyyy.MM.dd G \'at\' HH:mm:ss z", Calendar.getInstance().getTime()).toString());
ACRA.getErrorReporter().handleSilentException(new Exception("Exception saat set Drawer Counter"));
}
} catch (Exception e) {
FireCrash.log(e);
// TODO: handle exception
}
}
@Override
public void onDestroyView() {
super.onDestroyView();
Utility.freeMemory();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
screenName = FirebaseAnalytics.getInstance(getActivity());
View view = inflater.inflate(R.layout.new_fragment_survey_verification, container, false);
this.mSwipeRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.swipeRefreshLayout);
try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
this.mSwipeRefreshLayout.setColorScheme(
getResources().getColor(com.adins.mss.base.R.color.tv_light, getContext().getTheme()),
getResources().getColor(com.adins.mss.base.R.color.tv_normal, getContext().getTheme()),
getResources().getColor(com.adins.mss.base.R.color.tv_dark, getContext().getTheme()),
getResources().getColor(com.adins.mss.base.R.color.tv_darker, getContext().getTheme()));
} else {
this.mSwipeRefreshLayout.setColorScheme(
getResources().getColor(com.adins.mss.base.R.color.tv_light),
getResources().getColor(com.adins.mss.base.R.color.tv_normal),
getResources().getColor(com.adins.mss.base.R.color.tv_dark),
getResources().getColor(com.adins.mss.base.R.color.tv_darker));
}
} catch (Exception e) {
FireCrash.log(e);
this.mSwipeRefreshLayout.setColorSchemeResources(
com.adins.mss.base.R.color.tv_light,
com.adins.mss.base.R.color.tv_normal,
com.adins.mss.base.R.color.tv_dark,
com.adins.mss.base.R.color.tv_darker);
}
this.mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
public void onRefresh() {
SurveyVerificationFragment.this.initiateRefresh();
}
});
// 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_surveyverification));
// getActivity().getActionBar().setTitle(getString(com.adins.mss.base.R.string.title_mn_surveyverification));
recyclerView = (RecyclerView) view.findViewById(R.id.list);
layoutManager = new LinearLayoutManager(getContext());
recyclerView.setLayoutManager(layoutManager);
recyclerView.setHasFixedSize(true);
recyclerView.getRecycledViewPool().setMaxRecycledViews(1, 500);
recyclerView.setAdapter(adapter);
if(Global.ENABLE_USER_HELP &&
showDummy &&
Global.userHelpDummyGuide.get(SurveyVerificationFragment.this.getClass().getSimpleName()) != null &&
Global.userHelpDummyGuide.get(SurveyVerificationFragment.this.getClass().getSimpleName()).size()>0) {
NewTaskLogDummyAdapter dummyAdapter = new NewTaskLogDummyAdapter();
recyclerView.setAdapter(dummyAdapter);
UserHelpSVYDummy userHelpSVYDummy = new UserHelpSVYDummy();
userHelpSVYDummy.showDummyVerif(SurveyVerificationFragment.this.getActivity(),SurveyVerificationFragment.this.getClass().getSimpleName(), recyclerView,adapter);
showDummy = false;
}
// SurveyVerificationFragment.this.initiateRefresh();
return view;
}
private void initiateRefresh() {
// RefreshBackgroundTask task = new RefreshBackgroundTask();
// task.execute();
iSurveyActivity.getBackgroundTask(SurveyVerificationFragment.this, true, false);
}
private void onRefreshComplete(List<TaskH> result) {
this.mSwipeRefreshLayout.setRefreshing(false);
NiftyDialogBuilder fragment;
objects = result;
try {
// MSMainMenuActivity.mnSVYVerify.setCounter(String.valueOf(Constants.getCounterVerificationTask(getActivity())));
// if(MainMenuActivity.menuAdapter!=null)
// MainMenuActivity.menuAdapter.notifyDataSetChanged();
// MainMenuActivity.setDrawerCounter();
NewMainActivity.setCounter();
} catch (Exception e) { FireCrash.log(e);
ACRA.getErrorReporter().putCustomData("ErrorMainMenuActivity", e.getMessage());
ACRA.getErrorReporter().putCustomData("ErrorMainMenuActivity", DateFormat.format("yyyy.MM.dd G \'at\' HH:mm:ss z", Calendar.getInstance().getTime()).toString());
ACRA.getErrorReporter().handleSilentException(new Exception("Exception saat set Drawer Counter"));
}
// if (this.errMessage != null) {
// fragment = NiftyDialogBuilder.getInstance(this.context);
// fragment.withTitle(context.getString(com.adins.mss.base.R.string.error_capital)).withMessage(this.errMessage).show();
// } else
if (result != null && result.size() != 0) {
try {
//if(objects==null || objects.size()==0){
Constants.listOfVerifiedTask = objects;
adapter = new SurveyTaskAdapter(getActivity(), objects, SurveyVerificationFragment.this);
recyclerView.setAdapter(adapter);
//}
} catch (Exception e) { FireCrash.log(e);
// TODO: handle exception
}
}
// else {
// Constants.listOfVerifiedTask = objects;
// adapter = new TaskLogArrayAdapter(getActivity(), objects, false);
// listView.setAdapter(adapter);
// fragment = NiftyDialogBuilder.getInstance(this.context);
// fragment.withTitle(context.getString(com.adins.mss.base.R.string.info_capital)).withMessage(getString(com.adins.mss.base.R.string.msgNoVerification)).show();
// }
}
@Override
public void onDestroy() {
super.onDestroy();
adapter = null;
Constants.listOfVerifiedTask = null;
}
@Override
public void onResume() {
super.onResume();
// getActivity().getActionBar().removeAllTabs();
// getActivity().getActionBar().setTitle(getString(com.adins.mss.svy.R.string.title_mn_surveyverification));
// getActivity().getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
//Set Firebase screen name
screenName.setCurrentScreen(getActivity(), getString(R.string.screen_name_survey_verification), 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_surveyverification));
try {
// MSMainMenuActivity.mnSVYVerify.setCounter(String.valueOf(Constants.getCounterVerificationTask(getActivity())));
// if(MainMenuActivity.menuAdapter!=null)
// MainMenuActivity.menuAdapter.notifyDataSetChanged();
// MainMenuActivity.setDrawerCounter();
NewMainActivity.setCounter();
} catch (Exception e) { FireCrash.log(e);
ACRA.getErrorReporter().putCustomData("ErrorMainMenuActivity", e.getMessage());
ACRA.getErrorReporter().putCustomData("ErrorMainMenuActivity", DateFormat.format("yyyy.MM.dd G \'at\' HH:mm:ss z", Calendar.getInstance().getTime()).toString());
ACRA.getErrorReporter().handleSilentException(new Exception("Exception saat set Drawer Counter"));
}
// if(objects!=null && objects.size()>0){
objects = TaskHDataAccess.getAllVerifiedForUser(getActivity(), GlobalData.getSharedGlobalData().getUser().getUuid_user());
Constants.listOfVerifiedTask = objects;
// RefreshBackgroundTask task = new RefreshBackgroundTask();
// task.execute();
// }
}
@Override
public void onItemClickListener(TaskH item, int position) {
selectedVerified = item;
SurveyHeaderBean header = new SurveyHeaderBean(selectedVerified);
// TODO Action Lempar ke Customer ACtivity
Bundle bundle = new Bundle();
bundle.putSerializable(CustomerFragment.SURVEY_HEADER, header);
bundle.putInt(CustomerFragment.SURVEY_MODE, Global.MODE_VIEW_SENT_SURVEY);
Fragment fragment = com.adins.mss.base.dynamicform.CustomerFragment.create(header);
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, fragment);
transaction.addToBackStack(null);
transaction.commit();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if(item.getItemId() == R.id.mnGuide){
if(!Global.BACKPRESS_RESTRICTION) {
NewTaskLogDummyAdapter dummyAdapter = new NewTaskLogDummyAdapter();
recyclerView.setAdapter(dummyAdapter);
UserHelpSVYDummy userHelpSVYDummy = new UserHelpSVYDummy();
userHelpSVYDummy.showDummyVerif(SurveyVerificationFragment.this.getActivity(), SurveyVerificationFragment.this.getClass().getSimpleName(), recyclerView, adapter);
showDummy = false;
}
}
return super.onOptionsItemSelected(item);
}
@Override
public void onItemLongClickListener(TaskH item, int position) {
}
@Override
public void onRefreshBackgroundCancelled(boolean value) {
}
@Override
public void onRefreshBackgroundComplete(List<TaskH> result) {
onRefreshComplete(result);
}
// @SuppressLint({"NewApi"})
// private class RefreshBackgroundTask extends AsyncTask<Void, Void, List<TaskH>> {
// static final int TASK_DURATION = 5000;
//
// private RefreshBackgroundTask() {
// }
//
// protected List<TaskH> doInBackground(Void... params) {
// List<TaskH> resultTaskH = null;
// User user = GlobalData.getSharedGlobalData().getUser();
//
// if (Tool.isInternetconnected(context)) {
// MssRequestType requestType = new MssRequestType();
// requestType.setAudit(GlobalData.getSharedGlobalData().getAuditData());
// requestType.addImeiAndroidIdToUnstructured();
//
// String json = GsonHelper.toJson(requestType);
// String url = GlobalData.getSharedGlobalData().getURL_GET_LIST_VERIFICATION();
// boolean encrypt = GlobalData.getSharedGlobalData().isEncrypt();
// boolean decrypt = GlobalData.getSharedGlobalData().isDecrypt();
// HttpCryptedConnection httpConn = new HttpCryptedConnection(getActivity(), encrypt, decrypt);
// HttpConnectionResult serverResult = null;
// try {
// resultTaskH = TaskHDataAccess.getAllVerifiedForUser(context, GlobalData.getSharedGlobalData().getUser().getUuid_user());
// if (resultTaskH != null && resultTaskH.size() > 0)
// serverResult = httpConn.requestToServer(url, json, Global.SORTCONNECTIONTIMEOUT);
// else
// serverResult = httpConn.requestToServer(url, json, Global.DEFAULTCONNECTIONTIMEOUT);
// } catch (Exception e) { FireCrash.log(e);
// e.printStackTrace();
// errMessage = getActivity().getString(R.string.jsonParseFailed);
// }
//
// String result = serverResult.getResult();
//
// try {
// result = serverResult.getResult();
// JsonResponseTaskList taskList = GsonHelper.fromJson(result, JsonResponseTaskList.class);
// if (taskList.getStatus().getCode() == 0) {
// List<TaskH> listTaskH = taskList.getListTaskList();
// if (listTaskH != null && listTaskH.size() > 0) {
// String uuid_timelineType = TimelineTypeDataAccess.getTimelineTypebyType(getActivity(), Global.TIMELINE_TYPE_VERIFICATION).getUuid_timeline_type();
// for (TaskH taskHLocal : resultTaskH) {
// boolean wasDeleted = true;
// for (TaskH taskH : listTaskH) {
// if (taskH.getUuid_task_h().equals(taskHLocal.getUuid_task_h()))
// wasDeleted = false;
// }
// if (wasDeleted) {
// TaskHDataAccess.delete(getActivity(), taskHLocal);
// /*Timeline timeline = TimelineDataAccess.getOneTimelineByTaskH(getActivity(), user.getUuid_user(), taskHLocal.getUuid_task_h(), uuid_timelineType);
// if(timeline != null)
// TimelineDataAccess.delete(getActivity(), timeline);*/
// }
// }
//
// for (TaskH taskH : listTaskH) {
// taskH.setUser(user);
// String uuid_scheme = taskH.getUuid_scheme();
// Scheme scheme = SchemeDataAccess.getOne(getActivity(), uuid_scheme);
// if (scheme != null) {
// taskH.setScheme(scheme);
// TaskH h = TaskHDataAccess.getOneHeader(getActivity(), taskH.getUuid_task_h());
//
// boolean wasInTimeline = TimelineDataAccess.getOneTimelineByTaskH(getActivity(), user.getUuid_user(), taskH.getUuid_task_h(), uuid_timelineType) != null;
// if (h != null && h.getStatus() != null) {
// if (!ToDoList.isOldTask(h)) {
// TaskHDataAccess.addOrReplace(getActivity(), taskH);
// if (!wasInTimeline)
// TimelineManager.insertTimeline(getActivity(), taskH);
// }
// } else {
// TaskHDataAccess.addOrReplace(getActivity(), taskH);
// if (!wasInTimeline)
// TimelineManager.insertTimeline(getActivity(), taskH);
// }
// } else {
// errMessage = context.getString(com.adins.mss.base.R.string.scheme_not_found_verification);
// }
// }
// }
// } else {
// errMessage = result;
// }
// } catch (Exception e) { FireCrash.log(e);
// errMessage = getActivity().getString(R.string.jsonParseFailed);
// }
// }
//
// try {
//// if (context != null) {
//// resultTaskH = TaskHDataAccess.getAllVerifiedForUser(context, GlobalData.getSharedGlobalData().getUser().getUuid_user());
//// } else if (getActivity() != null) {
//// resultTaskH = TaskHDataAccess.getAllVerifiedForUser(context, GlobalData.getSharedGlobalData().getUser().getUuid_user());
//// } else {
//// resultTaskH = TaskHDataAccess.getAllVerifiedForUser(context, GlobalData.getSharedGlobalData().getUser().getUuid_user());
//// }
// } catch (Exception var6) {
// var6.printStackTrace();
// errMessage = var6.getMessage();
// }
//
// return resultTaskH;
// }
//
// protected void onPostExecute(List<TaskH> result) {
// super.onPostExecute(result);
// SurveyVerificationFragment.this.onRefreshComplete(result);
// }
// }
}

View file

@ -0,0 +1,81 @@
package com.adins.mss.base.checkin;
import android.app.Activity;
import android.content.Context;
import android.location.Location;
import android.os.Build;
import com.adins.mss.base.AppContext;
import com.adins.mss.base.checkin.activity.CheckInView;
import com.adins.mss.base.crashlytics.FireCrash;
import com.adins.mss.constant.Global;
import com.adins.mss.dao.LocationInfo;
import com.adins.mss.foundation.dialog.DialogManager;
import com.adins.mss.foundation.location.LocationTrackingManager;
import com.adins.mss.foundation.questiongenerator.form.LocationTagingView;
import com.google.android.gms.location.LocationListener;
import java.util.Date;
/**
* @author gigin.ginanjar
*/
public class CheckInLocationListener implements LocationListener {
public static Location currentLocation;
private LocationInfo locationInfo = new LocationInfo();
private Context mContext;
public CheckInLocationListener(Context context) {
mContext = context;
}
@Override
public void onLocationChanged(Location location) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
if (location.isFromMockProvider()){
DialogManager.showMockDialog(mContext);
return;
}
}
if (location == null) return;
if (location.getAccuracy() < 1000) {
currentLocation = location;
LocationTrackingManager ltm = Global.LTM;
Global.FLAG_LOCATION_TYPE = 1; //CheckIn
locationInfo = ltm.getCurrentLocation(Global.FLAG_LOCATION_CHECKIN);
locationInfo.setLatitude(String.valueOf(location.getLatitude()));
locationInfo.setLongitude(String.valueOf(location.getLongitude()));
Date date = new Date(location.getTime());
locationInfo.setGps_time(date);
locationInfo.setIs_gps_time(Global.TRUE_STRING);
locationInfo.setAccuracy(Math.round(location.getAccuracy()));
try {
CheckInView.setNewLocation();
} catch (Exception e) {
FireCrash.log(e);
// TODO: handle exception
}
try {
LocationTagingView.setNewLocation();
} catch (Exception e) {
FireCrash.log(e);
}
CheckInManager.stopPeriodicUpdates();
}
}
/**
* Get Current Location that have best Accuracy
*
* @return <b>Location</b>
*/
public LocationInfo getNewLocationInfo() {
return locationInfo;
}
}

View file

@ -0,0 +1,148 @@
package com.adins.mss.foundation.questiongenerator.form;
import android.content.Context;
import android.text.InputFilter;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import com.adins.mss.constant.Global;
import com.adins.mss.foundation.formatter.Tool;
import com.adins.mss.foundation.questiongenerator.OptionAnswerBean;
import com.adins.mss.foundation.questiongenerator.QuestionBean;
import java.util.List;
public class RadioQuestionView extends MultiOptionQuestionViewAbstract {
protected EditText txtDescription;
private RadioGroup radioGroup;
private boolean isFromDraft;
public RadioQuestionView(Context context, QuestionBean bean) {
super(context, bean);
radioGroup = new RadioGroup(context);
this.addView(radioGroup);
}
public void setRadioOptions(Context context, List<OptionAnswerBean> listOptions) {
setOptions(context, listOptions);
}
@Override
public void setOptions(Context context, List<OptionAnswerBean> options) {
this.options = options;
QuestionBean bean = getQuestionBean();
//clear view before adding more option
radioGroup.removeAllViews();
int i = 0;
for (OptionAnswerBean optBean : options) {
RadioButton rb = new RadioButton(context);
rb.setText(optBean.getValue());
// rb.setTextColor(Color.parseColor("#0b5d66"));
//manually set id
rb.setId(i);
if (bean.isReadOnly()) {
rb.setEnabled(false);
}
radioGroup.addView(rb, defLayout);
i++;
}
// set the radiogroup selected, after added.
int selected = Tool.getSelectedIndex(options);
if (selected != -1) {
//Glen 1 Oct 2014, test using provided method from android
getRadioGroup().check(selected);
}
if (bean.isReadOnly()) {
//Glen 1 Oct 2014, integrate with new class
// rdGroup.setClickable(false);
getRadioGroup().setClickable(false);
}
//Gigin : supaya pas ganti pilihan radio maka question selanjutnya dihapus
getRadioGroup().setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
if (group != null && group.getCheckedRadioButtonId() != -1) {
if (isFromDraft) {
isFromDraft = false;
} else {
setChanged(true);
}
}
}
});
selectSavedOptionsFromBeans(this.getSelectedOptionAnswers());
}
@Override
public void enableDescription(Context context) {
if (txtDescription == null) {
txtDescription = new EditText(context);
InputFilter[] inputFilters = {new InputFilter.LengthFilter(
Global.DEFAULT_MAX_LENGTH)};
txtDescription.setFilters(inputFilters);
addView(txtDescription, defLayout);
}
txtDescription.setVisibility(VISIBLE);
}
@Override
public void selectOption(int id, String desc) {
if (radioGroup != null) {
isFromDraft = true;
radioGroup.check(id);
}
if (desc != null) {
enableDescription(this.getContext());
txtDescription.setText(desc);
}
}
@Override
public void saveSelectedOptionToBean() {
//id returned is set as the order of elements in options
int selectedRadioId = radioGroup.getCheckedRadioButtonId();
if (selectedRadioId == -1) {
setSelectedOptionAnswer(null);
} else {
OptionAnswerBean selectedItem = options.get(selectedRadioId);
//check description if any
if (txtDescription != null) {
String description = txtDescription.getText().toString();
// selectedItem.setValue(description);
bean.setAnswer(description);
} else {
// selectedItem.setValue(null);
}
if (selectedItem != null) setSelectedOptionAnswer(selectedItem);
}
}
public RadioGroup getRadioGroup() {
return radioGroup;
}
public void setRadioGroup(RadioGroup radioGroup) {
this.radioGroup = radioGroup;
}
}

View file

@ -0,0 +1,114 @@
package com.adins.mss.svy.models;
import com.adins.mss.foundation.http.MssRequestType;
import com.google.gson.annotations.SerializedName;
public class RequestRejectedWithResurvey extends MssRequestType {
/** Property uuid_task_h */
@SerializedName("uuid_task_h")
String uuid_task_h;
/** Property flag */
@SerializedName("flag")
String flag;
/** Property uuid_user */
@SerializedName("uuid_user")
String uuid_user;
/** Property uuid_ms_user */
@SerializedName("uuid_ms_user")
String uuid_ms_user;
/** Property is_suggested */
@SerializedName("is_suggested")
String is_suggested;
/** Property notes */
@SerializedName("notes")
String notes;
/**
* Gets the uuid_ms_user
*/
public String getUuid_ms_user() {
return this.uuid_ms_user;
}
/**
* Sets the uuid_ms_user
*/
public void setUuid_ms_user(String value) {
this.uuid_ms_user = value;
}
/**
* Gets the is_suggested
*/
public String getIs_suggested() {
return this.is_suggested;
}
/**
* Sets the is_suggested
*/
public void setIs_suggested(String value) {
this.is_suggested = value;
}
/**
* Gets the notes
*/
public String getNotes() {
return this.notes;
}
/**
* Sets the notes
*/
public void setNotes(String value) {
this.notes = value;
}
/**
* 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;
}
/**
* Gets the flag
*/
public String getFlag() {
return this.flag;
}
/**
* Sets the flag
*/
public void setFlag(String value) {
this.flag = value;
}
/**
* Gets the uuid_user
*/
public String getUuid_user() {
return this.uuid_user;
}
/**
* Sets the uuid_user
*/
public void setUuid_user(String value) {
this.uuid_user = value;
}
}

View file

@ -0,0 +1,13 @@
package com.adins.mss.coll.models.loyaltymodels;
import com.adins.mss.foundation.http.MssRequestType;
import com.google.gson.annotations.SerializedName;
public class LoyaltyPointsRequest extends MssRequestType {
@SerializedName("MEMBERSHIP_PROGRAM_CODE")
public String membershipProgramId;
@SerializedName("LOGIN_ID")
public String loginId;
@SerializedName("POINT_GROUP")
public String pointGroup;
}

View file

@ -0,0 +1,170 @@
package org.acra;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.InputType;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
/**
* This is the dialog Activity used by ACRA to get authorization from the user
* to send reports. Requires android:launchMode="singleInstance" in your
* AndroidManifest to work properly.
**/
public class CrashReportDialog extends BaseCrashReportDialog implements DialogInterface.OnClickListener, DialogInterface.OnDismissListener {
private static final String STATE_EMAIL = "email";
private static final String STATE_COMMENT = "comment";
AlertDialog mDialog;
private EditText userCommentView;
private EditText userEmailView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);
final int titleResourceId = ACRA.getConfig().resDialogTitle();
if (titleResourceId != 0) {
dialogBuilder.setTitle(titleResourceId);
}
final int iconResourceId = ACRA.getConfig().resDialogIcon();
if (iconResourceId != 0) {
dialogBuilder.setIcon(iconResourceId);
}
dialogBuilder.setView(buildCustomView(savedInstanceState));
dialogBuilder.setPositiveButton(getText(ACRA.getConfig().resDialogPositiveButtonText()), CrashReportDialog.this);
//dialogBuilder.setNegativeButton(getText(ACRA.getConfig().resDialogNegativeButtonText()), CrashReportDialog.this);
mDialog = dialogBuilder.create();
mDialog.setCanceledOnTouchOutside(false);
mDialog.setCancelable(false);
mDialog.setOnDismissListener(this);
mDialog.show();
}
protected View buildCustomView(Bundle savedInstanceState) {
final LinearLayout root = new LinearLayout(this);
root.setOrientation(LinearLayout.VERTICAL);
root.setPadding(10, 10, 10, 10);
root.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
root.setFocusable(true);
root.setFocusableInTouchMode(true);
final ScrollView scroll = new ScrollView(this);
root.addView(scroll, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, 1.0f));
final LinearLayout scrollable = new LinearLayout(this);
scrollable.setOrientation(LinearLayout.VERTICAL);
scroll.addView(scrollable);
final TextView text = new TextView(this);
final int dialogTextId = ACRA.getConfig().resDialogText();
if (dialogTextId != 0) {
text.setText(getText(dialogTextId));
}
scrollable.addView(text);
// Add an optional prompt for user comments
final int commentPromptId = ACRA.getConfig().resDialogCommentPrompt();
if (commentPromptId != 0) {
final TextView label = new TextView(this);
label.setText(getText(commentPromptId));
label.setPadding(label.getPaddingLeft(), 10, label.getPaddingRight(), label.getPaddingBottom());
scrollable.addView(label, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT));
userCommentView = new EditText(this);
userCommentView.setLines(2);
if (savedInstanceState != null) {
String savedValue = savedInstanceState.getString(STATE_COMMENT);
if (savedValue != null) {
userCommentView.setText(savedValue);
}
}
scrollable.addView(userCommentView);
}
// Add an optional user email field
final int emailPromptId = ACRA.getConfig().resDialogEmailPrompt();
if (emailPromptId != 0) {
final TextView label = new TextView(this);
label.setText(getText(emailPromptId));
label.setPadding(label.getPaddingLeft(), 10, label.getPaddingRight(), label.getPaddingBottom());
scrollable.addView(label);
userEmailView = new EditText(this);
userEmailView.setSingleLine();
userEmailView.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
String savedValue = null;
if (savedInstanceState != null) {
savedValue = savedInstanceState.getString(STATE_EMAIL);
}
if (savedValue != null) {
userEmailView.setText(savedValue);
} else {
final SharedPreferences prefs = ACRA.getACRASharedPreferences();
userEmailView.setText(prefs.getString(ACRA.PREF_USER_EMAIL_ADDRESS, ""));
}
scrollable.addView(userEmailView);
}
return root;
}
@Override
public void onClick(DialogInterface dialog, int which) {
if (which == DialogInterface.BUTTON_POSITIVE) {
// Retrieve user comment
final String comment = userCommentView != null ? userCommentView.getText().toString() : "";
// Store the user email
final String userEmail;
final SharedPreferences prefs = ACRA.getACRASharedPreferences();
if (userEmailView != null) {
userEmail = userEmailView.getText().toString();
final SharedPreferences.Editor prefEditor = prefs.edit();
prefEditor.putString(ACRA.PREF_USER_EMAIL_ADDRESS, userEmail);
prefEditor.commit();
} else {
userEmail = prefs.getString(ACRA.PREF_USER_EMAIL_ADDRESS, "");
}
sendCrash(comment, userEmail);
} else {
cancelReports();
}
finish();
}
@Override
public void onDismiss(DialogInterface dialog) {
finish();
}
/*
* (non-Javadoc)
*
* @see android.app.Activity#onSaveInstanceState(android.os.Bundle)
*/
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
if (userCommentView != null && userCommentView.getText() != null) {
outState.putString(STATE_COMMENT, userCommentView.getText().toString());
}
if (userEmailView != null && userEmailView.getText() != null) {
outState.putString(STATE_EMAIL, userEmailView.getText().toString());
}
}
}

View file

@ -0,0 +1,20 @@
package com.adins.mss.base.todolist.form.followup;
import com.adins.mss.foundation.http.MssResponseType;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class FollowUpTaskListResponse extends MssResponseType {
@SerializedName("listFollowUpTask")
List<TaskListResponse> listFollowUpTask;
public List<TaskListResponse> getListFollowUpTask() {
return listFollowUpTask;
}
public void setListFollowUpTask(List<TaskListResponse> listFollowUpTask) {
this.listFollowUpTask = listFollowUpTask;
}
}

View file

@ -0,0 +1,105 @@
/*
* Copyright 2013 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package uk.co.senab.actionbarpulltorefresh.library;
import android.app.Activity;
import android.content.res.Configuration;
import android.view.View;
/**
* HeaderTransformers are what controls and update the Header View to reflect the current state
* of the pull-to-refresh interaction. They are responsible for showing and hiding the header
* view, as well as update the state.
*/
public abstract class HeaderTransformer {
/**
* Called whether the header view has been inflated from the resources
* defined in {@link Options#headerLayout}.
*
* @param activity The {@link android.app.Activity} that the header view is attached to.
* @param headerView The inflated header view.
*/
public void onViewCreated(Activity activity, View headerView) {
}
/**
* Called when the header should be reset. You should update any child
* views to reflect this.
* <p/>
* You should <strong>not</strong> change the visibility of the header
* view.
*/
public void onReset() {
}
/**
* Called the user has pulled on the scrollable view.
*
* @param percentagePulled value between 0.0f and 1.0f depending on how far the
* user has pulled.
*/
public void onPulled(float percentagePulled) {
}
/**
* Called when a refresh has begun. Theoretically this call is similar
* to that provided from {@link uk.co.senab.actionbarpulltorefresh.library.listeners.OnRefreshListener} but is more suitable
* for header view updates.
*/
public void onRefreshStarted() {
}
/**
* Called when a refresh can be initiated when the user ends the touch
* event. This is only called when {@link Options#refreshOnUp} is set to
* true.
*/
public void onReleaseToRefresh() {
}
/**
* Called when the current refresh has taken longer than the time
* specified in {@link Options#refreshMinimizeDelay}.
*/
public void onRefreshMinimized() {
}
/**
* Called when the Header View should be made visible, usually with an animation.
*
* @return true if the visibility has changed.
*/
public abstract boolean showHeaderView();
/**
* Called when the Header View should be made invisible, usually with an animation.
*
* @return true if the visibility has changed.
*/
public abstract boolean hideHeaderView();
/**
* Called when the Activity's configuration has changed.
*
* @param activity The {@link android.app.Activity} that the header view is attached to.
* @param newConfig New configuration.
* @see android.app.Activity#onConfigurationChanged(android.content.res.Configuration)
*/
public void onConfigurationChanged(Activity activity, Configuration newConfig) {
}
}

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true" >
<alpha
android:duration="1000"
android:fromAlpha="0.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:toAlpha="1.0" />
</set>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB