mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-06-30 21:04:16 +00:00
add project adins
This commit is contained in:
parent
ad06ac5505
commit
f8f85d679d
5299 changed files with 625430 additions and 0 deletions
|
@ -0,0 +1,7 @@
|
|||
package com.adins.mss.base.models;
|
||||
|
||||
import com.adins.mss.foundation.http.MssResponseType;
|
||||
|
||||
public class GetDataTableResponse extends MssResponseType {
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.adins.mss.base.checkin;
|
||||
|
||||
import com.adins.mss.foundation.http.MssResponseType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* Created by ahmadkamilalmasyhur on 21/02/2018.
|
||||
*/
|
||||
|
||||
public class JsonResponseAbsensi extends MssResponseType {
|
||||
@SerializedName("result")
|
||||
String result;
|
||||
@SerializedName("success")
|
||||
String success;
|
||||
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public String getSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccsess(String success) {
|
||||
this.success = success;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.adins.mss.coll;
|
||||
|
||||
import com.adins.mss.foundation.http.MssResponseType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class GetLogoKompetisiResponse extends MssResponseType {
|
||||
|
||||
@SerializedName("LOGO")
|
||||
protected String LOGO;
|
||||
|
||||
public String getLOGO() {
|
||||
return LOGO;
|
||||
}
|
||||
|
||||
public void setLOGO(String LOGO) {
|
||||
this.LOGO = LOGO;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,154 @@
|
|||
/*
|
||||
* Copyright 2012 Kevin Gaudin
|
||||
*
|
||||
* 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 org.acra;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import static org.acra.ReportField.ANDROID_VERSION;
|
||||
import static org.acra.ReportField.APP_VERSION_CODE;
|
||||
import static org.acra.ReportField.APP_VERSION_NAME;
|
||||
import static org.acra.ReportField.AVAILABLE_MEM_SIZE;
|
||||
import static org.acra.ReportField.BRAND;
|
||||
import static org.acra.ReportField.BUILD;
|
||||
import static org.acra.ReportField.BUILD_CONFIG;
|
||||
import static org.acra.ReportField.CRASH_CONFIGURATION;
|
||||
import static org.acra.ReportField.CUSTOM_DATA;
|
||||
import static org.acra.ReportField.DEVICE_FEATURES;
|
||||
import static org.acra.ReportField.DISPLAY;
|
||||
import static org.acra.ReportField.DUMPSYS_MEMINFO;
|
||||
import static org.acra.ReportField.ENVIRONMENT;
|
||||
import static org.acra.ReportField.FILE_PATH;
|
||||
import static org.acra.ReportField.INITIAL_CONFIGURATION;
|
||||
import static org.acra.ReportField.INSTALLATION_ID;
|
||||
import static org.acra.ReportField.IS_SILENT;
|
||||
import static org.acra.ReportField.LOGCAT;
|
||||
import static org.acra.ReportField.PACKAGE_NAME;
|
||||
import static org.acra.ReportField.PHONE_MODEL;
|
||||
import static org.acra.ReportField.PRODUCT;
|
||||
import static org.acra.ReportField.REPORT_ID;
|
||||
import static org.acra.ReportField.SETTINGS_GLOBAL;
|
||||
import static org.acra.ReportField.SETTINGS_SECURE;
|
||||
import static org.acra.ReportField.SETTINGS_SYSTEM;
|
||||
import static org.acra.ReportField.SHARED_PREFERENCES;
|
||||
import static org.acra.ReportField.STACK_TRACE;
|
||||
import static org.acra.ReportField.TOTAL_MEM_SIZE;
|
||||
import static org.acra.ReportField.USER_APP_START_DATE;
|
||||
import static org.acra.ReportField.USER_COMMENT;
|
||||
import static org.acra.ReportField.USER_CRASH_DATE;
|
||||
import static org.acra.ReportField.USER_EMAIL;
|
||||
|
||||
/**
|
||||
* Responsible for collating those constants shared among the ACRA components.
|
||||
*
|
||||
* @author William Ferguson
|
||||
* @since 4.3.0
|
||||
*/
|
||||
public final class ACRAConstants {
|
||||
|
||||
public static final String REPORTFILE_EXTENSION = ".stacktrace";
|
||||
/**
|
||||
* Used in the intent starting CrashReportDialog to provide the name of the
|
||||
* latest generated report file in order to be able to associate the user
|
||||
* comment.
|
||||
*/
|
||||
public static final String EXTRA_REPORT_FILE_NAME = "REPORT_FILE_NAME";
|
||||
/**
|
||||
* Used in the intent starting CrashReportDialog to provide the Exception that caused the crash.
|
||||
* <p>
|
||||
* This can be used by any BaseCrashReportDialog subclass to custom the dialog.
|
||||
*/
|
||||
public static final String EXTRA_REPORT_EXCEPTION = "REPORT_EXCEPTION";
|
||||
/**
|
||||
* A special String value to allow the usage of a pseudo-null default value
|
||||
* in annotation parameters.
|
||||
*/
|
||||
public static final String NULL_VALUE = "ACRA-NULL-STRING";
|
||||
public static final boolean DEFAULT_FORCE_CLOSE_DIALOG_AFTER_TOAST = false;
|
||||
public static final int DEFAULT_MAX_NUMBER_OF_REQUEST_RETRIES = 3;
|
||||
public static final int DEFAULT_SOCKET_TIMEOUT = 5000;
|
||||
public static final int DEFAULT_CONNECTION_TIMEOUT = 3000;
|
||||
public static final boolean DEFAULT_DELETE_UNAPPROVED_REPORTS_ON_APPLICATION_START = true;
|
||||
public static final boolean DEFAULT_DELETE_OLD_UNSENT_REPORTS_ON_APPLICATION_START = true;
|
||||
public static final int DEFAULT_DROPBOX_COLLECTION_MINUTES = 5;
|
||||
public static final boolean DEFAULT_INCLUDE_DROPBOX_SYSTEM_TAGS = false;
|
||||
public static final int DEFAULT_SHARED_PREFERENCES_MODE = Context.MODE_PRIVATE;
|
||||
public static final int DEFAULT_NOTIFICATION_ICON = android.R.drawable.stat_notify_error;
|
||||
public static final int DEFAULT_DIALOG_ICON = android.R.drawable.ic_dialog_alert;
|
||||
public static final int DEFAULT_DIALOG_POSITIVE_BUTTON_TEXT = android.R.string.ok;
|
||||
public static final int DEFAULT_DIALOG_NEGATIVE_BUTTON_TEXT = android.R.string.cancel;
|
||||
public static final int DEFAULT_RES_VALUE = 0;
|
||||
public static final String DEFAULT_STRING_VALUE = "";
|
||||
public static final int DEFAULT_LOGCAT_LINES = 100;
|
||||
public static final int DEFAULT_BUFFER_SIZE_IN_BYTES = 8192;
|
||||
public static final boolean DEFAULT_LOGCAT_FILTER_BY_PID = false;
|
||||
public static final boolean DEFAULT_SEND_REPORTS_IN_DEV_MODE = true;
|
||||
public static final boolean DEFAULT_SEND_REPORTS_AT_SHUTDOWN = true;
|
||||
public static final String DEFAULT_APPLICATION_LOGFILE = DEFAULT_STRING_VALUE;
|
||||
public static final int DEFAULT_APPLICATION_LOGFILE_LINES = DEFAULT_LOGCAT_LINES;
|
||||
public static final boolean DEFAULT_DISABLE_SSL_CERT_VALIDATION = false;
|
||||
public static final String DEFAULT_HTTP_SOCKET_FACTORY_FACTORY_CLASS = "org.acra.util.DefaultHttpsSocketFactoryFactory";
|
||||
/**
|
||||
* Default list of {@link ReportField}s to be sent in email reports. You can
|
||||
* set your own list with
|
||||
* {@link org.acra.annotation.ReportsCrashes#customReportContent()}.
|
||||
*
|
||||
* @see org.acra.annotation.ReportsCrashes#mailTo()
|
||||
*/
|
||||
public final static ReportField[] DEFAULT_MAIL_REPORT_FIELDS = {USER_COMMENT, ANDROID_VERSION, APP_VERSION_NAME,
|
||||
BRAND, PHONE_MODEL, CUSTOM_DATA, STACK_TRACE};
|
||||
/**
|
||||
* Default list of {@link ReportField}s to be sent in reports. You can set
|
||||
* your own list with
|
||||
* {@link org.acra.annotation.ReportsCrashes#customReportContent()}.
|
||||
*/
|
||||
public static final ReportField[] DEFAULT_REPORT_FIELDS = {REPORT_ID, APP_VERSION_CODE, APP_VERSION_NAME,
|
||||
PACKAGE_NAME, FILE_PATH, PHONE_MODEL, BRAND, PRODUCT, ANDROID_VERSION, BUILD, TOTAL_MEM_SIZE,
|
||||
AVAILABLE_MEM_SIZE, BUILD_CONFIG, CUSTOM_DATA, IS_SILENT, STACK_TRACE, INITIAL_CONFIGURATION, CRASH_CONFIGURATION,
|
||||
DISPLAY, USER_COMMENT, USER_EMAIL, USER_APP_START_DATE, USER_CRASH_DATE, DUMPSYS_MEMINFO, LOGCAT,
|
||||
INSTALLATION_ID, DEVICE_FEATURES, ENVIRONMENT, SHARED_PREFERENCES, SETTINGS_SYSTEM, SETTINGS_SECURE,
|
||||
SETTINGS_GLOBAL};
|
||||
public static final String DATE_TIME_FORMAT_STRING = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ";
|
||||
/**
|
||||
* Set this extra to true to force the deletion of reports by the
|
||||
* {@link CrashReportDialog} activity.
|
||||
*/
|
||||
protected static final String EXTRA_FORCE_CANCEL = "FORCE_CANCEL";
|
||||
/**
|
||||
* Suffix to be added to report files when they have been approved by the
|
||||
* user in NOTIFICATION mode
|
||||
*/
|
||||
static final String APPROVED_SUFFIX = "-approved";
|
||||
/**
|
||||
* This key is used to store the silent state of a report sent by
|
||||
* handleSilentException().
|
||||
*/
|
||||
static final String SILENT_SUFFIX = "-" + IS_SILENT;
|
||||
/**
|
||||
* This is the number of previously stored reports that we send in
|
||||
* {@link SendWorker#checkAndSendReports(android.content.Context, boolean)}.
|
||||
* The number of reports is limited to avoid ANR on application start.
|
||||
*/
|
||||
static final int MAX_SEND_REPORTS = 5;
|
||||
/**
|
||||
* This is the identifier (value = 666) use for the status bar notification
|
||||
* issued when crashes occur.
|
||||
*/
|
||||
static final int NOTIF_CRASH_ID = 666;
|
||||
/**
|
||||
* Number of milliseconds to wait after displaying a toast.
|
||||
*/
|
||||
static final int TOAST_WAIT_DURATION = 2000;
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright (C) 2013 Manuel Peinado
|
||||
*
|
||||
* 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 com.manuelpeinado.fadingactionbar;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ActionBar;
|
||||
import android.app.Activity;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
public class FadingActionBarHelper extends FadingActionBarHelperBase {
|
||||
|
||||
private ActionBar mActionBar;
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@Override
|
||||
public void initActionBar(Activity activity) {
|
||||
mActionBar = activity.getActionBar();
|
||||
super.initActionBar(activity);
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@Override
|
||||
protected int getActionBarHeight() {
|
||||
return mActionBar.getHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isActionBarNull() {
|
||||
return mActionBar == null;
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
@Override
|
||||
protected void setActionBarBackgroundDrawable(Drawable drawable) {
|
||||
mActionBar.setBackgroundDrawable(drawable);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="false" android:color="@android:color/darker_gray" />
|
||||
<item android:state_focused="true" android:color="@android:color/white" />
|
||||
<item android:state_pressed="true" android:color="@android:color/white" />
|
||||
<item android:color="@android:color/white" />
|
||||
</selector>
|
|
@ -0,0 +1,41 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/no"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:gravity="center_horizontal"/>
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/timelineLine" />
|
||||
<TextView
|
||||
android:id="@+id/dueDate"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:gravity="center_horizontal"/>
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/timelineLine" />
|
||||
<TextView
|
||||
android:id="@+id/amountInstallment"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:gravity="center_horizontal"/>
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/timelineLine" />
|
||||
<TextView
|
||||
android:id="@+id/amountPaid"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:gravity="center_horizontal"/>
|
||||
</TableRow>
|
|
@ -0,0 +1,225 @@
|
|||
package com.adins.mss.coll.loyalti.pointacquisitiondaily;
|
||||
|
||||
import com.adins.mss.coll.loyalti.pointacquisitiondaily.contracts.DailyPointContract;
|
||||
import com.adins.mss.coll.loyalti.pointacquisitionmonthly.contracts.ILoyaltyPointsDataSource;
|
||||
import com.adins.mss.coll.models.loyaltymodels.GroupPointData;
|
||||
import com.adins.mss.coll.models.loyaltymodels.LoyaltyPointsRequest;
|
||||
import com.adins.mss.coll.models.loyaltymodels.LoyaltyPointsResponse;
|
||||
import com.adins.mss.coll.models.loyaltymodels.PointDetail;
|
||||
import com.adins.mss.coll.models.loyaltymodels.RankDetail;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class DailyPointsPresenter implements DailyPointContract.Presenter, ILoyaltyPointsDataSource.ReqPointsListener {
|
||||
|
||||
private DailyPointContract.View view;
|
||||
private DailyPointsLogic dailyPointsLogic;
|
||||
|
||||
//data hold
|
||||
private LoyaltyPointsResponse pointsData;
|
||||
|
||||
public DailyPointsPresenter(DailyPointContract.View view, DailyPointsLogic logic) {
|
||||
this.view = view;
|
||||
this.dailyPointsLogic = logic;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDailyPointsData(LoyaltyPointsRequest reqData) {
|
||||
dailyPointsLogic.getDailyPointsData(reqData,this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getAvgPoint() {
|
||||
return dailyPointsLogic.getAvgPoint(pointsData.dataDetail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxPoint() {
|
||||
return dailyPointsLogic.getMaxPoint(pointsData.dataDetail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTotalPoints() {
|
||||
return dailyPointsLogic.getTotalPoints(pointsData.dataDetail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCurrentDay() {
|
||||
//cek bulan yang dipilih
|
||||
int currDay = 0;
|
||||
|
||||
if(pointsData == null || pointsData.dataDetail.size() == 0)
|
||||
return currDay;
|
||||
|
||||
String[] timevalues;
|
||||
if(pointsData.dataDetail.get(0).isDay()){
|
||||
GroupPointData groupPointData = pointsData.dataDetail.get(0);
|
||||
timevalues = groupPointData.getGroupPointValue();
|
||||
}
|
||||
else {
|
||||
return currDay;
|
||||
}
|
||||
|
||||
//set date from timevalues
|
||||
Calendar calendarNow = Calendar.getInstance();
|
||||
|
||||
int year,month,date;
|
||||
date = Integer.valueOf(timevalues[0]) - 1;
|
||||
month = Integer.valueOf(timevalues[1]) - 1;
|
||||
year = Integer.valueOf(timevalues[2]);
|
||||
|
||||
//check current month
|
||||
calendarNow.setTime(new Date());
|
||||
int currMonth = calendarNow.get(Calendar.MONTH);
|
||||
boolean isPreviousMonth = false;
|
||||
|
||||
if(currMonth > month){
|
||||
//use last day on selected month
|
||||
isPreviousMonth = true;
|
||||
calendarNow.set(Calendar.MONTH, month);
|
||||
calendarNow.set(Calendar.DAY_OF_MONTH, calendarNow.getActualMaximum(Calendar.DAY_OF_MONTH));
|
||||
currDay = calendarNow.get(Calendar.DAY_OF_MONTH);
|
||||
}
|
||||
else {
|
||||
//get current day
|
||||
currDay = calendarNow.get(Calendar.DAY_OF_MONTH);
|
||||
}
|
||||
|
||||
int pointDataDay;
|
||||
boolean dayFound = false;
|
||||
for (int i=0; i< pointsData.dataDetail.size(); i++) {
|
||||
GroupPointData group = pointsData.dataDetail.get(i);
|
||||
if(group == null)
|
||||
continue;
|
||||
|
||||
pointDataDay = Integer.valueOf(group.getGroupPointValue()[0]);
|
||||
if(pointDataDay == currDay){
|
||||
dayFound = true;
|
||||
currDay = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(isPreviousMonth && !dayFound){
|
||||
currDay = currDay - 1;
|
||||
}
|
||||
|
||||
if(currDay >= pointsData.dataDetail.size()){
|
||||
currDay = pointsData.dataDetail.size() - 1;
|
||||
}
|
||||
|
||||
return currDay;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getDays() {
|
||||
if(pointsData == null || pointsData.dataDetail.size() == 0)
|
||||
return new String[]{};
|
||||
|
||||
String[] dayNames = new String[pointsData.dataDetail.size()];
|
||||
List<GroupPointData> groups = pointsData.dataDetail;
|
||||
|
||||
for(int i=0; i<groups.size(); i++){
|
||||
GroupPointData groupData = groups.get(i);
|
||||
if(groupData.isDay()){
|
||||
dayNames[i] = groupData.getGroupPointValue()[0];
|
||||
}
|
||||
}
|
||||
|
||||
return dayNames;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GroupPointData getPointDataAt(int monthIdx) {
|
||||
if(pointsData == null || pointsData.dataDetail.size() == 0)
|
||||
return null;
|
||||
return pointsData.dataDetail.get(monthIdx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PointDetail> getPointDetails() {
|
||||
if(pointsData == null)
|
||||
return null;
|
||||
List<PointDetail> pointCategories = new ArrayList<>();
|
||||
for (GroupPointData groupPoint:pointsData.dataDetail) {
|
||||
if(groupPoint == null)
|
||||
continue;
|
||||
if(groupPoint.pointDetails == null || groupPoint.pointDetails.size() == 0)
|
||||
continue;
|
||||
|
||||
for (PointDetail pointDetail:groupPoint.pointDetails) {
|
||||
if(pointDetail == null)
|
||||
continue;
|
||||
if(isContainsPointDetails(pointCategories,pointDetail.rewardProgram)){
|
||||
continue;
|
||||
}
|
||||
pointCategories.add(pointDetail);
|
||||
}
|
||||
}
|
||||
|
||||
return pointCategories;
|
||||
}
|
||||
|
||||
private boolean isContainsPointDetails(List<PointDetail> list,String rewardProgram){
|
||||
boolean result = false;
|
||||
for (PointDetail pointDetail:list){
|
||||
if(pointDetail.rewardProgram.equals(rewardProgram)){
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RankDetail> getRanks() {
|
||||
if(pointsData == null || pointsData.dataDetail.size() == 0)
|
||||
return null;
|
||||
|
||||
return pointsData.dataDetail.get(0).rankDetails;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(LoyaltyPointsResponse pointsData) {
|
||||
if(pointsData == null || pointsData.dataDetail.size() == 0){
|
||||
view.onGetDataFailed("No data detail found");
|
||||
return;
|
||||
}
|
||||
|
||||
this.pointsData = pointsData;
|
||||
//convert point and rank data to 2d array to satisfy view
|
||||
float[][] pointDataSet = new float[pointsData.dataDetail.size()][];
|
||||
RankDetail[][] rankDataSet = new RankDetail[pointsData.dataDetail.size()][pointsData.dataDetail.get(0).rankDetails.size()];
|
||||
List<PointDetail> pointDetailsDataSet = new ArrayList<>();
|
||||
|
||||
for(int i=0; i<pointDataSet.length; i++){
|
||||
float[] yVals = new float[pointsData.dataDetail.get(i).pointDetails.size()];
|
||||
for (int j=0; j<yVals.length; j++){
|
||||
yVals[j] = Integer.valueOf(pointsData.dataDetail.get(i).pointDetails.get(j).point);
|
||||
pointDetailsDataSet.add(pointsData.dataDetail.get(i).pointDetails.get(j));
|
||||
}
|
||||
pointDataSet[i] = yVals;
|
||||
}
|
||||
|
||||
for(int i=0; i<rankDataSet.length; i++){
|
||||
for (int j=0; j<rankDataSet[i].length; j++){
|
||||
rankDataSet[i][j] = pointsData.dataDetail.get(i).rankDetails.get(j);
|
||||
}
|
||||
}
|
||||
|
||||
view.onDataReceived(pointDataSet,rankDataSet,pointDetailsDataSet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(String message) {
|
||||
view.onGetDataFailed(message);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
<?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">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="110dp"
|
||||
android:background="#76000000">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_save_picture"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:background="@drawable/ic_check"
|
||||
android:layout_marginRight="25dp"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:layout_alignTop="@+id/btn_cancel"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_cancel"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:background="@drawable/icon_close"
|
||||
android:layout_marginLeft="25dp"
|
||||
android:layout_marginStart="25dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
|
@ -0,0 +1,17 @@
|
|||
package com.adins.mss.base.dynamicform.form.models;
|
||||
|
||||
import com.adins.mss.foundation.http.MssResponseType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class JsonDataSpResponse extends MssResponseType {
|
||||
@SerializedName("result")
|
||||
private String result;
|
||||
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,150 @@
|
|||
package com.adins.mss.odr.catalogue.imageslider;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Handler;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
/**
|
||||
* Created by olivia.dg on 11/28/2017.
|
||||
*/
|
||||
|
||||
public class SliderIndicator implements ViewPager.OnPageChangeListener {
|
||||
private Context mContext;
|
||||
private LinearLayout mContainer;
|
||||
private int mDrawable;
|
||||
private int mSpacing;
|
||||
private int mSize;
|
||||
private ViewPager mViewPager;
|
||||
private int mPageCount;
|
||||
private int mInitialPage = 0;
|
||||
private boolean isAutomaticSlide = false;
|
||||
|
||||
private int defaultSizeInDp = 12;
|
||||
private int defaultSpacingInDp = 12;
|
||||
|
||||
public SliderIndicator(Context context, LinearLayout containerView, ViewPager viewPager, int drawableRes, boolean isAutomaticSlide) {
|
||||
if (context == null) {
|
||||
throw new IllegalArgumentException("context cannot be null");
|
||||
} else if (containerView == null) {
|
||||
throw new IllegalArgumentException("containerView cannot be null");
|
||||
} else if (viewPager == null) {
|
||||
throw new IllegalArgumentException("ViewPager cannot be null");
|
||||
} else if (viewPager.getAdapter() == null) {
|
||||
throw new IllegalArgumentException("ViewPager does not have an adapter set on it.");
|
||||
}
|
||||
mContext = context;
|
||||
mContainer = containerView;
|
||||
mDrawable = drawableRes;
|
||||
mViewPager = viewPager;
|
||||
this.isAutomaticSlide = isAutomaticSlide;
|
||||
}
|
||||
|
||||
public void setPageCount(int pageCount) {
|
||||
mPageCount = pageCount;
|
||||
}
|
||||
|
||||
public void setInitialPage(int page) {
|
||||
mInitialPage = page;
|
||||
}
|
||||
|
||||
public void setDrawable(int drawable) {
|
||||
mDrawable = drawable;
|
||||
}
|
||||
|
||||
public void setSpacingRes(int spacingRes) {
|
||||
mSpacing = spacingRes;
|
||||
}
|
||||
|
||||
public void setSize(int dimenRes) {
|
||||
mSize = dimenRes;
|
||||
}
|
||||
|
||||
public void show() {
|
||||
initIndicators();
|
||||
setIndicatorAsSelected(mInitialPage);
|
||||
if(isAutomaticSlide){
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override public void run() {
|
||||
try {
|
||||
mViewPager.setCurrentItem(1, true);
|
||||
} catch (IllegalArgumentException e) {
|
||||
|
||||
}
|
||||
}
|
||||
}, 2500);
|
||||
}
|
||||
}
|
||||
|
||||
private void initIndicators() {
|
||||
if (mContainer == null || mPageCount <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
mViewPager.addOnPageChangeListener(this);
|
||||
Resources res = mContext.getResources();
|
||||
mContainer.removeAllViews();
|
||||
for (int i = 0; i < mPageCount; i++) {
|
||||
View view = new View(mContext);
|
||||
int dimen = mSize != 0 ? res.getDimensionPixelSize(mSize) : ((int) res.getDisplayMetrics().density * defaultSizeInDp);
|
||||
int margin = mSpacing != 0 ? res.getDimensionPixelSize(mSpacing) : ((int) res.getDisplayMetrics().density * defaultSpacingInDp);
|
||||
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(dimen, dimen);
|
||||
lp.setMargins(i == 0 ? 0 : margin, 0, 0, 0);
|
||||
view.setLayoutParams(lp);
|
||||
view.setBackgroundResource(mDrawable);
|
||||
view.setSelected(i == 0);
|
||||
mContainer.addView(view);
|
||||
}
|
||||
}
|
||||
|
||||
private void setIndicatorAsSelected(int index) {
|
||||
if (mContainer == null) {
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < mContainer.getChildCount(); i++) {
|
||||
View view = mContainer.getChildAt(i);
|
||||
try {
|
||||
view.setSelected(i == index);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
int index = position % mPageCount;
|
||||
setIndicatorAsSelected(index);
|
||||
final int moveTo = position + 1;
|
||||
if(isAutomaticSlide){
|
||||
try {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override public void run() {
|
||||
try {
|
||||
mViewPager.setCurrentItem(moveTo, true);
|
||||
} catch (IllegalArgumentException ex) {
|
||||
|
||||
}
|
||||
}
|
||||
}, 2500);
|
||||
}catch (Exception e){
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
}
|
||||
|
||||
public void cleanup() {
|
||||
mViewPager.clearOnPageChangeListeners();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,132 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_grayscale"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttonSend"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@drawable/button_background"
|
||||
android:text="@string/btnSend"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/fontColorWhite" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="46dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/deposit_report"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/transferAsBank"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtTransferTo"
|
||||
style="@style/FieldLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_transfer_to" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatSpinner
|
||||
android:id="@+id/spinnerBankAccount"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/dropdown_background"
|
||||
android:padding="5dp"
|
||||
android:spinnerMode="dropdown" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@+id/spinnerBankAccount"
|
||||
android:layout_alignEnd="@+id/spinnerBankAccount"
|
||||
android:layout_alignBottom="@+id/spinnerBankAccount"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:tint="@color/colorMC"
|
||||
app:srcCompat="@drawable/ic_expand" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/activity_vertical_margin" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtBuktiTransfer"
|
||||
style="@style/FieldLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_transfer_evidence_2" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageBukti"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="#EEE" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttonSelectPhoto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/button_background"
|
||||
android:text="@string/take_a_photo"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/fontColorWhite" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/transferAsCashier"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtCashierName"
|
||||
style="@style/FieldLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/label_cashier_name_2" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editNamaKasir"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
|
@ -0,0 +1,41 @@
|
|||
package com.adins.mss.foundation.print.rv;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Created by angga.permadi on 4/20/2016.
|
||||
*/
|
||||
public class RVEntity {
|
||||
@SerializedName("uuid_task_h")
|
||||
private String uuid_task_h;
|
||||
@SerializedName("rv_number")
|
||||
private String rv_number;
|
||||
@SerializedName("dtm_use")
|
||||
private Date dtm_use;
|
||||
|
||||
public String getUuid_task_h() {
|
||||
return uuid_task_h;
|
||||
}
|
||||
|
||||
public void setUuid_task_h(String uuid_task_h) {
|
||||
this.uuid_task_h = uuid_task_h;
|
||||
}
|
||||
|
||||
public String getRv_number() {
|
||||
return rv_number;
|
||||
}
|
||||
|
||||
public void setRv_number(String rv_number) {
|
||||
this.rv_number = rv_number;
|
||||
}
|
||||
|
||||
public Date getDtm_use() {
|
||||
return dtm_use;
|
||||
}
|
||||
|
||||
public void setDtm_use(Date dtm_use) {
|
||||
this.dtm_use = dtm_use;
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
Loading…
Add table
Add a link
Reference in a new issue