mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-07-01 05:14:17 +00:00
add project adins
This commit is contained in:
parent
ad06ac5505
commit
f8f85d679d
5299 changed files with 625430 additions and 0 deletions
|
@ -0,0 +1,42 @@
|
|||
<?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/questionLuOnlineLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/questionTextLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0. label" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@drawable/button_background"
|
||||
android:text="@string/btnView"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/fontColorWhite" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imgPhotoLuOnlineAnswer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.5"
|
||||
android:gravity="center"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_camera"
|
||||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutListDocument"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" />
|
||||
|
||||
</com.adins.mss.foundation.questiongenerator.form.QuestionView>
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/image_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/dummy" />
|
|
@ -0,0 +1,59 @@
|
|||
package com.adins.mss.base;
|
||||
|
||||
import android.content.Context;
|
||||
import com.adins.mss.base.dynamicform.TaskManager;
|
||||
import com.adins.mss.dao.TaskH;
|
||||
import com.adins.mss.foundation.db.dataaccess.TaskHDataAccess;
|
||||
import com.adins.mss.foundation.security.storepreferences.ObscuredSharedPreferences;
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.powermock.api.mockito.PowerMockito;
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||
import org.powermock.modules.junit4.PowerMockRunner;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@RunWith(PowerMockRunner.class)
|
||||
@PrepareForTest(FirebaseCrashlytics.class)
|
||||
public class SubmitFailedDraftTaskTest{
|
||||
|
||||
@Mock
|
||||
Context mockContext;
|
||||
@Mock
|
||||
ObscuredSharedPreferences sharedPreferences;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
PowerMockito.mockStatic(FirebaseCrashlytics.class);
|
||||
when(mockContext.getApplicationContext()).thenReturn(mockContext);
|
||||
}
|
||||
@Test
|
||||
public void SendTaskOnBackgroundTest() {
|
||||
TaskH taskH = new TaskH();
|
||||
taskH.setUuid_task_h("5523735");
|
||||
taskH.setCustomer_name("test1");
|
||||
taskH.setCustomer_phone("089898989898");
|
||||
taskH.setCustomer_address("jl. test1");
|
||||
try {
|
||||
TaskManager.isSubmitFailedDraft(mockContext, taskH, null);
|
||||
}catch (Exception e){}
|
||||
assertEquals(TaskHDataAccess.STATUS_SEND_SAVEDRAFT, taskH.getStatus());
|
||||
|
||||
// final CountDownLatch signal = new CountDownLatch(1);
|
||||
// final TaskManager.SendTaskOnBackground task = new TaskManager.SendTaskOnBackground(mockContext, Global.MODE_SURVEY_TASK,header,
|
||||
// listOfQuestions, false);
|
||||
// task.execute();
|
||||
//
|
||||
// assertEquals(false,Global.isManualSubmit);
|
||||
// TaskManager.isSubmitFailedDraft(mockContext, taskH, );
|
||||
// Timeline timeline = TimelineDataAccess.getOneTimelineByTaskH(mockContext, GlobalData.getSharedGlobalData().getUser().getUuid_user(), "5523735", "C38BB627-4100-11EA-B586-45FFA0B13D54");
|
||||
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 199 B |
|
@ -0,0 +1,115 @@
|
|||
package com.adins.mss.svy.reassignment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.adins.mss.constant.Global;
|
||||
import com.adins.mss.foundation.UserHelp.UserHelp;
|
||||
import com.adins.mss.svy.R;
|
||||
import com.google.firebase.analytics.FirebaseAnalytics;
|
||||
|
||||
import org.acra.ACRA;
|
||||
|
||||
import static com.adins.mss.constant.Global.SHOW_USERHELP_DELAY_DEFAULT;
|
||||
|
||||
public class OrderFilterActivity extends CheckOrderActivity{
|
||||
private int taskType;
|
||||
private Spinner cbSearchByStatus;
|
||||
private TextView labelSearchByStatus;
|
||||
private RelativeLayout layoutFilterByStatus;
|
||||
private Bundle mArguments;
|
||||
private FirebaseAnalytics screenName;
|
||||
public OrderFilterActivity() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Context activity) {
|
||||
super.onAttach(activity);
|
||||
setHasOptionsMenu(true);
|
||||
ACRA.getErrorReporter().putCustomData("LAST_CLASS_ACCESSED", getClass().getSimpleName());
|
||||
mArguments = getArguments();
|
||||
taskType = mArguments.getInt(Global.BUND_KEY_TASK_TYPE, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if(item.getItemId() == R.id.mnGuide){
|
||||
if(!Global.BACKPRESS_RESTRICTION) {
|
||||
|
||||
Handler handler = new Handler();
|
||||
handler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
UserHelp.showAllUserHelp(OrderFilterActivity.this.getActivity(), OrderFilterActivity.this.getClass().getSimpleName());
|
||||
}
|
||||
}, SHOW_USERHELP_DELAY_DEFAULT);
|
||||
}
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
super.onCreateView(inflater, container, savedInstanceState);
|
||||
screenName = FirebaseAnalytics.getInstance(getActivity());
|
||||
Handler handler = new Handler();
|
||||
handler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
UserHelp.showAllUserHelp(OrderFilterActivity.this.getActivity(),OrderFilterActivity.this.getClass().getSimpleName());
|
||||
}
|
||||
}, SHOW_USERHELP_DELAY_DEFAULT);
|
||||
return view;
|
||||
}
|
||||
|
||||
private void addStatusFilter() {
|
||||
labelSearchByStatus = (TextView)view.findViewById(R.id.lblSearchByStatus);
|
||||
cbSearchByStatus = (Spinner)view.findViewById(R.id.cbSearchByStatus);
|
||||
layoutFilterByStatus = (RelativeLayout)view.findViewById(R.id.filterByStatus);
|
||||
labelSearchByStatus.setVisibility(View.VISIBLE);
|
||||
layoutFilterByStatus.setVisibility(View.VISIBLE);
|
||||
ArrayAdapter<CharSequence> adapter=ArrayAdapter.createFromResource
|
||||
(getActivity(), R.array.cbSearchByStatus,R.layout.spinner_style);
|
||||
cbSearchByStatus.setAdapter(adapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Intent getNextActivityIntent() {
|
||||
Intent intent =null;
|
||||
if(taskType==Global.TASK_ORDER_REASSIGNMENT){
|
||||
intent = new Intent(getActivity(), OrderReassignmentResult.class);
|
||||
intent.putExtra(Global.BUND_KEY_TASK_TYPE, taskType);
|
||||
}
|
||||
|
||||
return intent;
|
||||
}
|
||||
@Override
|
||||
public void onResume(){
|
||||
super.onResume();
|
||||
// getActivity().getActionBar().removeAllTabs();
|
||||
//Set Firebase screen name
|
||||
screenName.setCurrentScreen(getActivity(), getString(R.string.screen_name_survey_reassignment), null);
|
||||
if(taskType==Global.TASK_CANCEL_ORDER){
|
||||
// getActivity().getActionBar().setTitle(getString(R.string.title_mn_cancelorder));
|
||||
}
|
||||
else if(taskType==Global.TASK_ORDER_REASSIGNMENT){
|
||||
// getActivity().getActionBar().setTitle(getString(R.string.title_mn_surveyreassign));
|
||||
|
||||
// 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_surveyreassign));
|
||||
}
|
||||
// getActivity().getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<corners
|
||||
android:radius="10dp" />
|
||||
<padding
|
||||
android:left="5dp"
|
||||
android:top="5dp"
|
||||
android:right="5dp"
|
||||
android:bottom="5dp" />
|
||||
<solid
|
||||
android:color="#99c0c0c0"
|
||||
/>
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
|
@ -0,0 +1,30 @@
|
|||
package com.adins.mss.base.todo;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
||||
import com.adins.mss.base.dynamicform.SurveyHeaderBean;
|
||||
import com.adins.mss.foundation.questiongenerator.QuestionBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface Task {
|
||||
|
||||
// boolean saveTask(Activity activity, int mode, SurveyHeaderBean header, List<QuestionBean> listOfQuestions, String uuid_last_question, boolean send, boolean draft);
|
||||
|
||||
// String saveTask(Activity activity, int mode, SurveyHeaderBean header, List<QuestionBean> listOfQuestions);
|
||||
|
||||
// String[] doPreSubmitNewSurveyTask(Context context, String taskId, boolean isPartial) throws Exception;
|
||||
|
||||
void saveAndSendTask(Activity activity, String taskId, boolean isPrintable, boolean finishActivity);
|
||||
|
||||
//GGI
|
||||
void saveAndSendTask(Activity activity, int mode, SurveyHeaderBean header, List<QuestionBean> listOfQuestions);
|
||||
|
||||
void sendTaskManual(Activity activity, SurveyHeaderBean header, boolean finishActivity);
|
||||
|
||||
void saveAndSendTaskOnBackground(Context activity, String taskId, boolean isPrintable, boolean finishActivity);
|
||||
|
||||
void saveAndSendTaskOnBackground(Activity activity, int mode, SurveyHeaderBean header, List<QuestionBean> listOfQuestions, boolean isTaskPaid);
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
|
@ -0,0 +1,56 @@
|
|||
package com.adins.mss.coll.loyalti.barchart.pointlegends;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.adins.mss.coll.R;
|
||||
import com.adins.mss.coll.models.loyaltymodels.PointDetail;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PointLegendsAdapter extends BaseAdapter {
|
||||
|
||||
private Context context;
|
||||
private List<PointDetail> dataset;
|
||||
|
||||
public PointLegendsAdapter(Context context, List<PointDetail> dataset) {
|
||||
this.context = context;
|
||||
this.dataset = dataset;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return dataset.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
return dataset.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
if(convertView == null){
|
||||
convertView = LayoutInflater.from(context).inflate(R.layout.point_legend_item,parent,false);
|
||||
}
|
||||
|
||||
PointDetail item = dataset.get(position);
|
||||
ImageView colorRect = convertView.findViewById(R.id.legendColorRect);
|
||||
colorRect.setColorFilter(item.colorValue);
|
||||
TextView legendText = convertView.findViewById(R.id.legendText);
|
||||
legendText.setText(item.rewardProgram);
|
||||
|
||||
return convertView;
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue