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,67 @@
|
|||
package com.mikepenz.aboutlibraries.entity;
|
||||
|
||||
/**
|
||||
* Created by mikepenz on 08.06.14.
|
||||
*/
|
||||
public class License {
|
||||
private String definedName;
|
||||
|
||||
private String licenseName;
|
||||
private String licenseWebsite;
|
||||
private String licenseShortDescription;
|
||||
private String licenseDescription;
|
||||
|
||||
public License() {
|
||||
}
|
||||
|
||||
public License(String licenseName, String licenseWebsite, String licenseShortDescription, String licenseDescription) {
|
||||
this.licenseName = licenseName;
|
||||
this.licenseWebsite = licenseWebsite;
|
||||
this.licenseShortDescription = licenseShortDescription;
|
||||
this.licenseDescription = licenseDescription;
|
||||
}
|
||||
|
||||
public License copy() {
|
||||
return new License(this.licenseName, this.licenseWebsite, this.licenseShortDescription, this.licenseDescription);
|
||||
}
|
||||
|
||||
public String getDefinedName() {
|
||||
return definedName;
|
||||
}
|
||||
|
||||
public void setDefinedName(String definedName) {
|
||||
this.definedName = definedName;
|
||||
}
|
||||
|
||||
public String getLicenseName() {
|
||||
return licenseName;
|
||||
}
|
||||
|
||||
public void setLicenseName(String licenseName) {
|
||||
this.licenseName = licenseName;
|
||||
}
|
||||
|
||||
public String getLicenseWebsite() {
|
||||
return licenseWebsite;
|
||||
}
|
||||
|
||||
public void setLicenseWebsite(String licenseWebsite) {
|
||||
this.licenseWebsite = licenseWebsite;
|
||||
}
|
||||
|
||||
public String getLicenseShortDescription() {
|
||||
return licenseShortDescription;
|
||||
}
|
||||
|
||||
public void setLicenseShortDescription(String licenseShortDescription) {
|
||||
this.licenseShortDescription = licenseShortDescription;
|
||||
}
|
||||
|
||||
public String getLicenseDescription() {
|
||||
return licenseDescription;
|
||||
}
|
||||
|
||||
public void setLicenseDescription(String licenseDescription) {
|
||||
this.licenseDescription = licenseDescription;
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
|
@ -0,0 +1,103 @@
|
|||
package com.adins.mss.dao;
|
||||
|
||||
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 "MS_GROUPTASK".
|
||||
*/
|
||||
public class GroupTask {
|
||||
|
||||
/** Not-null value. */
|
||||
@SerializedName("uuid_group_task")
|
||||
private String uuid_group_task;
|
||||
@SerializedName("group_task_id")
|
||||
private String group_task_id;
|
||||
@SerializedName("uuid_account")
|
||||
private String uuid_account;
|
||||
@SerializedName("status_code")
|
||||
private String last_status;
|
||||
@SerializedName("product_name")
|
||||
private String product_name;
|
||||
@SerializedName("project_nett")
|
||||
private Integer project_nett;
|
||||
@SerializedName("dtm_crt")
|
||||
private java.util.Date dtm_crt;
|
||||
|
||||
public GroupTask() {
|
||||
}
|
||||
|
||||
public GroupTask(String uuid_group_task) {
|
||||
this.uuid_group_task = uuid_group_task;
|
||||
}
|
||||
|
||||
public GroupTask(String uuid_group_task, String group_task_id, String uuid_account, String last_status, String product_name, Integer project_nett, java.util.Date dtm_crt) {
|
||||
this.uuid_group_task = uuid_group_task;
|
||||
this.group_task_id = group_task_id;
|
||||
this.uuid_account = uuid_account;
|
||||
this.last_status = last_status;
|
||||
this.product_name = product_name;
|
||||
this.project_nett = project_nett;
|
||||
this.dtm_crt = dtm_crt;
|
||||
}
|
||||
|
||||
/** Not-null value. */
|
||||
public String getUuid_group_task() {
|
||||
return uuid_group_task;
|
||||
}
|
||||
|
||||
/** Not-null value; ensure this value is available before it is saved to the database. */
|
||||
public void setUuid_group_task(String uuid_group_task) {
|
||||
this.uuid_group_task = uuid_group_task;
|
||||
}
|
||||
|
||||
public String getGroup_task_id() {
|
||||
return group_task_id;
|
||||
}
|
||||
|
||||
public void setGroup_task_id(String group_task_id) {
|
||||
this.group_task_id = group_task_id;
|
||||
}
|
||||
|
||||
public String getUuid_account() {
|
||||
return uuid_account;
|
||||
}
|
||||
|
||||
public void setUuid_account(String uuid_account) {
|
||||
this.uuid_account = uuid_account;
|
||||
}
|
||||
|
||||
public String getLast_status() {
|
||||
return last_status;
|
||||
}
|
||||
|
||||
public void setLast_status(String last_status) {
|
||||
this.last_status = last_status;
|
||||
}
|
||||
|
||||
public String getProduct_name() {
|
||||
return product_name;
|
||||
}
|
||||
|
||||
public void setProduct_name(String product_name) {
|
||||
this.product_name = product_name;
|
||||
}
|
||||
|
||||
public Integer getProject_nett() {
|
||||
return project_nett;
|
||||
}
|
||||
|
||||
public void setProject_nett(Integer project_nett) {
|
||||
this.project_nett = project_nett;
|
||||
}
|
||||
|
||||
public java.util.Date getDtm_crt() {
|
||||
return dtm_crt;
|
||||
}
|
||||
|
||||
public void setDtm_crt(java.util.Date dtm_crt) {
|
||||
this.dtm_crt = dtm_crt;
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
|
@ -0,0 +1,145 @@
|
|||
package com.adins.mss.base.dynamicform.form.questions.viewholder;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.adins.mss.base.GlobalData;
|
||||
import com.adins.mss.base.R;
|
||||
import com.adins.mss.base.crashlytics.FireCrash;
|
||||
import com.adins.mss.base.dynamicform.DynamicFormActivity;
|
||||
import com.adins.mss.base.dynamicform.form.questions.DrawingCanvasActivity;
|
||||
import com.adins.mss.base.dynamicform.form.questions.ImageViewerActivity;
|
||||
import com.adins.mss.base.dynamicform.form.questions.OnQuestionClickListener;
|
||||
import com.adins.mss.base.util.Utility;
|
||||
import com.adins.mss.constant.Global;
|
||||
import com.adins.mss.dao.User;
|
||||
import com.adins.mss.foundation.formatter.Tool;
|
||||
import com.adins.mss.foundation.image.Utils;
|
||||
import com.adins.mss.foundation.questiongenerator.QuestionBean;
|
||||
import com.adins.mss.foundation.questiongenerator.form.QuestionView;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
/**
|
||||
* Created by gigin.ginanjar on 01/09/2016.
|
||||
*/
|
||||
public class DrawingQuestionViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||
public QuestionView mView;
|
||||
public TextView mQuestionLabel;
|
||||
public ImageView mImageEdit;
|
||||
public QuestionBean bean;
|
||||
public FragmentActivity mActivity;
|
||||
public OnQuestionClickListener mListener;
|
||||
private int group;
|
||||
private int position;
|
||||
private User user;
|
||||
|
||||
public DrawingQuestionViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
mView = (QuestionView) itemView.findViewById(R.id.questionDrawingLayout);
|
||||
mQuestionLabel = (TextView) itemView.findViewById(R.id.questionDrawingLabel);
|
||||
mImageEdit = (ImageView) itemView.findViewById(R.id.imgDrawing);
|
||||
}
|
||||
|
||||
public DrawingQuestionViewHolder(View itemView, FragmentActivity activity, OnQuestionClickListener listener) {
|
||||
super(itemView);
|
||||
mView = (QuestionView) itemView.findViewById(R.id.questionDrawingLayout);
|
||||
mQuestionLabel = (TextView) itemView.findViewById(R.id.questionDrawingLabel);
|
||||
mImageEdit = (ImageView) itemView.findViewById(R.id.imgDrawing);
|
||||
mActivity = activity;
|
||||
mListener = listener;
|
||||
}
|
||||
|
||||
public void bind(final QuestionBean item, int group, int number) {
|
||||
bean = item;
|
||||
this.group = group;
|
||||
position = number - 1;
|
||||
String qLabel = number + ". " + bean.getQuestion_label();
|
||||
user = GlobalData.getSharedGlobalData().getUser();
|
||||
|
||||
mQuestionLabel.setText(qLabel);
|
||||
|
||||
final byte[] img = bean.getImgAnswer();
|
||||
mImageEdit.setOnClickListener(this);
|
||||
if (img != null && img.length > 0) {
|
||||
new BitmapWorkerTask(mImageEdit).execute(bean);
|
||||
} else {
|
||||
if (!user.getFlag_job().equalsIgnoreCase("JOB MH")){
|
||||
mImageEdit.setImageResource(android.R.drawable.ic_menu_edit);
|
||||
}else{
|
||||
mImageEdit.setImageResource(android.R.drawable.ic_menu_gallery);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
if (DynamicFormActivity.getIsVerified() || DynamicFormActivity.getIsApproval() || user.getFlag_job().equalsIgnoreCase("JOB MH")) {
|
||||
if(bean.getImgAnswer() != null){
|
||||
try {
|
||||
Global.getSharedGlobal().setIsViewer(true);
|
||||
Bundle extras = new Bundle();
|
||||
extras.putByteArray(ImageViewerActivity.BUND_KEY_IMAGE, bean.getImgAnswer());
|
||||
extras.putInt(ImageViewerActivity.BUND_KEY_IMAGE_QUALITY, Utils.picQuality);
|
||||
extras.putBoolean(ImageViewerActivity.BUND_KEY_IMAGE_ISVIEWER, Global.getSharedGlobal().getIsViewer());
|
||||
Intent intent = new Intent(mActivity, ImageViewerActivity.class);
|
||||
intent.putExtras(extras);
|
||||
mActivity.startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
FireCrash.log(e);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
mListener.onEditDrawingClick(bean, group, position);
|
||||
Intent intent = new Intent(mActivity, DrawingCanvasActivity.class);
|
||||
DrawingCanvasActivity.bean = new QuestionBean(bean);
|
||||
if (bean.getImgAnswer() != null)
|
||||
DrawingCanvasActivity.bean.setImgAnswer(bean.getImgAnswer());
|
||||
mActivity.startActivityForResult(intent, Global.REQUEST_DRAWING_QUESTION);
|
||||
}
|
||||
}
|
||||
|
||||
class BitmapWorkerTask extends AsyncTask<QuestionBean, Void, Bitmap> {
|
||||
private final WeakReference<ImageView> imageViewReference;
|
||||
private byte[] data;
|
||||
private int[] resolusi;
|
||||
|
||||
public BitmapWorkerTask(ImageView imageView) {
|
||||
imageViewReference = new WeakReference<>(imageView);
|
||||
}
|
||||
|
||||
// Decode image in background.
|
||||
@Override
|
||||
protected Bitmap doInBackground(QuestionBean... params) {
|
||||
QuestionBean bean = params[0];
|
||||
data = bean.getImgAnswer();
|
||||
Bitmap bm = Utils.byteToBitmap(data);
|
||||
resolusi = new int[2];
|
||||
resolusi[0] = bm.getWidth();
|
||||
resolusi[1] = bm.getHeight();
|
||||
int[] res = Tool.getThumbnailResolution(bm.getWidth(), bm.getHeight());
|
||||
Bitmap thumbnail = Bitmap.createScaledBitmap(bm, res[0], res[1], true);
|
||||
return thumbnail;
|
||||
}
|
||||
|
||||
// Once complete, see if ImageView is still around and set bitmap.
|
||||
@Override
|
||||
protected void onPostExecute(Bitmap bitmap) {
|
||||
if (imageViewReference != null && bitmap != null) {
|
||||
final ImageView imageView = imageViewReference.get();
|
||||
if (imageView != null) {
|
||||
imageView.setImageBitmap(bitmap);
|
||||
}
|
||||
}
|
||||
Utility.freeMemory();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.adins.mss.base.loyalti.barchart;
|
||||
|
||||
import com.github.mikephil.charting.formatter.ValueFormatter;
|
||||
|
||||
public class LoyaltyXLabelFormatter extends ValueFormatter {
|
||||
|
||||
private String[] labels;
|
||||
|
||||
public LoyaltyXLabelFormatter(String[] labels) {
|
||||
this.labels = labels;
|
||||
}
|
||||
|
||||
public int getLabelCount(){
|
||||
if(labels == null)
|
||||
return 0;
|
||||
return labels.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFormattedValue(float value) {
|
||||
int idx = Math.round(value);
|
||||
if(labels.length == 0)
|
||||
return "";
|
||||
|
||||
if(idx < 0 || idx >= labels.length)
|
||||
return "";
|
||||
|
||||
return labels[idx];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* Copyright (C) 2010 The Android Open Source Project
|
||||
*
|
||||
* 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.adins.libs.nineoldandroids.animation;
|
||||
|
||||
/**
|
||||
* This evaluator can be used to perform type interpolation between integer
|
||||
* values that represent ARGB colors.
|
||||
*/
|
||||
public class ArgbEvaluator implements TypeEvaluator {
|
||||
|
||||
/**
|
||||
* This function returns the calculated in-between value for a color
|
||||
* given integers that represent the start and end values in the four
|
||||
* bytes of the 32-bit int. Each channel is separately linearly interpolated
|
||||
* and the resulting calculated values are recombined into the return value.
|
||||
*
|
||||
* @param fraction The fraction from the starting to the ending values
|
||||
* @param startValue A 32-bit int value representing colors in the
|
||||
* separate bytes of the parameter
|
||||
* @param endValue A 32-bit int value representing colors in the
|
||||
* separate bytes of the parameter
|
||||
* @return A value that is calculated to be the linearly interpolated
|
||||
* result, derived by separating the start and end values into separate
|
||||
* color channels and interpolating each one separately, recombining the
|
||||
* resulting values in the same way.
|
||||
*/
|
||||
public Object evaluate(float fraction, Object startValue, Object endValue) {
|
||||
int startInt = (Integer) startValue;
|
||||
int startA = (startInt >> 24);
|
||||
int startR = (startInt >> 16) & 0xff;
|
||||
int startG = (startInt >> 8) & 0xff;
|
||||
int startB = startInt & 0xff;
|
||||
|
||||
int endInt = (Integer) endValue;
|
||||
int endA = (endInt >> 24);
|
||||
int endR = (endInt >> 16) & 0xff;
|
||||
int endG = (endInt >> 8) & 0xff;
|
||||
int endB = endInt & 0xff;
|
||||
|
||||
return (int) ((startA + (int) (fraction * (endA - startA))) << 24) |
|
||||
(int) ((startR + (int) (fraction * (endR - startR))) << 16) |
|
||||
(int) ((startG + (int) (fraction * (endG - startG))) << 8) |
|
||||
(int) ((startB + (int) (fraction * (endB - startB))));
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
|
@ -0,0 +1,163 @@
|
|||
<?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:background="@drawable/bg_color" >
|
||||
|
||||
<include
|
||||
android:id="@+id/include1"
|
||||
layout="@layout/footer" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@+id/layoutSyncQuestionSet"
|
||||
android:layout_centerHorizontal="true" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewSyncScheme"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/sync_scheme"
|
||||
android:textSize="10dp"
|
||||
android:textColor="@color/tv_darker" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewSyncSchemeDone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_toRightOf="@+id/textViewSyncScheme"
|
||||
android:textColor="@color/tv_darker"
|
||||
android:textSize="10dp"
|
||||
android:textStyle="italic" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutSyncQuestionSet"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@+id/layoutSyncLookup"
|
||||
android:layout_centerHorizontal="true" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewSyncQuestionSet"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/sync_question_set"
|
||||
android:textSize="10dp"
|
||||
android:textColor="@color/tv_darker" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewSyncQuestionSetDone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:textSize="10dp"
|
||||
android:layout_toRightOf="@+id/textViewSyncQuestionSet"
|
||||
android:textColor="@color/tv_darker"
|
||||
android:textStyle="italic" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutSyncLookup"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@+id/layoutSyncHoliday"
|
||||
android:layout_centerHorizontal="true" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewSyncLookup"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/sync_lookup"
|
||||
android:textSize="10dp"
|
||||
android:textColor="@color/tv_darker" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewSyncLookupDone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:textSize="10dp"
|
||||
android:layout_toRightOf="@+id/textViewSyncLookup"
|
||||
android:textColor="@color/tv_darker"
|
||||
android:textStyle="italic" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutSyncHoliday"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_above="@+id/progressBar"
|
||||
android:layout_marginBottom="8dp" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewSyncHoliday"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/sync_holiday"
|
||||
android:textSize="10dp"
|
||||
android:textColor="@color/tv_darker" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textViewSyncHolidayDone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:textSize="10dp"
|
||||
android:layout_toRightOf="@+id/textViewSyncHoliday"
|
||||
android:textColor="@color/tv_darker"
|
||||
android:textStyle="italic" />
|
||||
</LinearLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@+id/lblStatus"
|
||||
android:layout_alignWithParentIfMissing="false"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerInParent="false"
|
||||
android:layout_centerVertical="false"
|
||||
android:layout_marginBottom="58dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:indeterminate="false"
|
||||
android:max="100"
|
||||
android:minWidth="240dp" />
|
||||
|
||||
<!--
|
||||
<TextView
|
||||
android:id="@+id/textView1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@+id/progressBar"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="Synchronizing"
|
||||
android:textColor="@color/tv_darker" />
|
||||
-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lblStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:textColor="@android:color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/progressLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignTop="@id/progressBar"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_centerInParent="false"
|
||||
android:layout_marginTop="26dp"
|
||||
android:text="Progress : 0%"
|
||||
android:textColor="@color/tv_darker" />
|
||||
|
||||
</RelativeLayout>
|
|
@ -0,0 +1,31 @@
|
|||
package com.adins.mss.base.commons;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.adins.mss.base.GlobalData;
|
||||
import com.adins.mss.base.NewMainActivity;
|
||||
import com.adins.mss.base.util.LocaleHelper;
|
||||
|
||||
/**
|
||||
* Created by kusnendi.muhamad on 31/07/2017.
|
||||
*/
|
||||
|
||||
public class SettingImpl implements SettingInterface {
|
||||
private Context context;
|
||||
|
||||
public SettingImpl(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLanguage() {
|
||||
return LocaleHelper.getLanguage(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLanguage(String language) {
|
||||
LocaleHelper.setLocale(context, language);
|
||||
GlobalData.getSharedGlobalData().setLocale(language);
|
||||
NewMainActivity.updateMenuSettings();
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,105 @@
|
|||
package com.adins.mss.main;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
|
||||
import com.adins.mss.base.AppContext;
|
||||
import com.adins.mss.base.GlobalData;
|
||||
import com.adins.mss.base.crashlytics.FireCrash;
|
||||
import com.adins.mss.constant.Global;
|
||||
import com.adins.mss.foundation.config.ConfigFileReader;
|
||||
import com.adins.mss.odr.BuildConfig;
|
||||
import com.adins.mss.odr.NewMOMainActivity;
|
||||
import com.adins.mss.odr.R;
|
||||
import com.google.firebase.FirebaseApp;
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||
|
||||
import org.acra.ACRA;
|
||||
import org.acra.ACRAConfiguration;
|
||||
import org.acra.ACRAConfigurationException;
|
||||
import org.acra.ReportField;
|
||||
import org.acra.ReportingInteractionMode;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* Created by wendy.ac on 10/02/20109.
|
||||
*/
|
||||
|
||||
public class MSMApplication extends AppContext {
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
context = getApplicationContext();
|
||||
|
||||
final ACRAConfiguration config = new ACRAConfiguration();
|
||||
if (BuildConfig.FLAVOR.contains("prod")) {
|
||||
config.setFormUri("http://app.ad-ins.com:5984/acra-aitmss-prod/_design/acra-storage/_update/report");
|
||||
} else {
|
||||
config.setFormUri("http://app.ad-ins.com:5984/acra-aitmss-dev/_design/acra-storage/_update/report");
|
||||
}
|
||||
// else {
|
||||
// config.setFormUri("http://app.ad-ins.com:5984/acra-wfimoscs-dev/_design/acra-storage/_update/report");
|
||||
// }
|
||||
config.setReportType(org.acra.sender.HttpSender.Type.JSON);
|
||||
config.setHttpMethod(org.acra.sender.HttpSender.Method.PUT);
|
||||
config.setFormUriBasicAuthLogin("admin");
|
||||
config.setFormUriBasicAuthPassword("12345");
|
||||
ReportField[] customReportContent = {
|
||||
ReportField.APP_VERSION_CODE,
|
||||
ReportField.APP_VERSION_NAME,
|
||||
ReportField.ANDROID_VERSION,
|
||||
ReportField.INSTALLATION_ID,
|
||||
ReportField.PACKAGE_NAME,
|
||||
ReportField.REPORT_ID,
|
||||
ReportField.BUILD,
|
||||
ReportField.STACK_TRACE,
|
||||
ReportField.AVAILABLE_MEM_SIZE,
|
||||
ReportField.TOTAL_MEM_SIZE,
|
||||
ReportField.SETTINGS_SECURE,
|
||||
ReportField.DISPLAY,
|
||||
ReportField.CUSTOM_DATA,
|
||||
ReportField.SHARED_PREFERENCES
|
||||
};
|
||||
config.setCustomReportContent(customReportContent);
|
||||
|
||||
//disable acra => set acra custom preference sesuai app.properties
|
||||
Properties properties = ConfigFileReader.propertiesFromFile(this, GlobalData.PROPERTY_FILENAME);
|
||||
boolean disableAcra = Boolean.parseBoolean(properties.getProperty(GlobalData.PROP_DISABLE_ACRA));
|
||||
Global.ACRA_DISABLED = disableAcra;
|
||||
String acraCustomPrefName = "ACRACUSTOMPREF";
|
||||
SharedPreferences acracustompref = getSharedPreferences(acraCustomPrefName, Context.MODE_PRIVATE);
|
||||
acracustompref.edit().putBoolean(ACRA.PREF_DISABLE_ACRA,disableAcra).commit();
|
||||
|
||||
config.setSharedPreferenceName(acraCustomPrefName);
|
||||
config.setSharedPreferenceMode(Context.MODE_PRIVATE);
|
||||
|
||||
try {
|
||||
config.setMode(ReportingInteractionMode.TOAST);
|
||||
} catch (ACRAConfigurationException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
config.setResToastText(R.string.toast_crash);
|
||||
|
||||
ACRA.init(this, config);
|
||||
|
||||
//setting firebase crashlytic instance
|
||||
FirebaseApp.initializeApp(this);
|
||||
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);
|
||||
FireCrash.setInstance(FirebaseCrashlytics.getInstance());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class getHomeClass() {
|
||||
return NewMOMainActivity.class;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @TargetApi(Build.VERSION_CODES.N)
|
||||
// protected void attachBaseContext(Context newBase) {
|
||||
// super.attachBaseContext(LocaleHelper.onAttach(newBase));
|
||||
// }
|
||||
}
|
|
@ -0,0 +1,132 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/content"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/account"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:background="@color/gradient_end"
|
||||
android:padding="10dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<de.hdodenhof.circleimageview.CircleImageView
|
||||
android:id="@+id/imageProfile"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="90dp"
|
||||
android:layout_margin="10dp"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/profile_pic"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/imageProfile"
|
||||
android:layout_centerVertical="true"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:text=""
|
||||
android:textStyle="bold"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/fontColorWhite"
|
||||
android:drawableLeft="@drawable/ic_person_white"
|
||||
android:drawableTint="@color/fontColorWhite"
|
||||
android:drawablePadding="10dp"
|
||||
android:elevation="5dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtJob"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:text="Sales Dealer"
|
||||
android:textStyle="bold"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/fontColorWhite"
|
||||
android:drawableLeft="@drawable/ic_job_white"
|
||||
android:drawablePadding="10dp"
|
||||
android:elevation="5dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtDealer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:text="Dealer ADI Utama"
|
||||
android:textStyle="bold"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/fontColorWhite"
|
||||
android:drawableLeft="@drawable/ic_location_white"
|
||||
android:drawablePadding="10dp"
|
||||
android:elevation="5dp"/>
|
||||
<TextView
|
||||
android:id="@+id/txtCurrentCOH"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:text="Current COH : 2,000,000.00"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/fontColorWhite"
|
||||
android:drawableLeft="@drawable/ic_cash_white"
|
||||
android:drawablePadding="10dp"
|
||||
android:elevation="5dp"
|
||||
android:visibility="gone"/>
|
||||
<TextView
|
||||
android:id="@+id/txtLimitCOH"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif-light"
|
||||
android:text="Limit COH: 10,000,000.00"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="@color/fontColorWhite"
|
||||
android:drawableLeft="@drawable/ic_money_limit"
|
||||
android:drawablePadding="10dp"
|
||||
android:elevation="5dp"
|
||||
android:visibility="gone"/>
|
||||
</LinearLayout>
|
||||
<!--<ImageButton-->
|
||||
<!--android:id="@+id/btnLanguage"-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:layout_alignParentRight="true"-->
|
||||
<!--android:layout_marginRight="5dp"-->
|
||||
<!--android:src="@drawable/english"-->
|
||||
<!--android:background="@drawable/circle_button" />-->
|
||||
<!--<ImageButton-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:layout_toLeftOf="@id/btnLanguage"-->
|
||||
<!--android:layout_marginRight="5dp"-->
|
||||
<!--android:src="@drawable/ic_key_color"-->
|
||||
<!--android:background="@drawable/circle_shape"-->
|
||||
<!--android:padding="5dp"/>-->
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/menuRecycle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/account"
|
||||
android:fitsSystemWindows="true"
|
||||
android:clipToPadding="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginTop="3dp" />
|
||||
|
||||
</RelativeLayout>
|
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<rotate
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="-50"
|
||||
android:pivotY="50%"
|
||||
android:pivotX="50%"
|
||||
android:duration="200"/>
|
||||
<rotate
|
||||
android:startOffset="200"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="100"
|
||||
android:pivotY="50%"
|
||||
android:pivotX="50%"
|
||||
android:duration="400"/>
|
||||
<rotate
|
||||
android:startOffset="600"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="-100"
|
||||
android:pivotY="50%"
|
||||
android:pivotX="50%"
|
||||
android:duration="400"/>
|
||||
<rotate
|
||||
android:startOffset="1000"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="100"
|
||||
android:pivotY="50%"
|
||||
android:pivotX="50%"
|
||||
android:duration="400"/>
|
||||
<rotate
|
||||
android:startOffset="1400"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="-100"
|
||||
android:pivotY="50%"
|
||||
android:pivotX="50%"
|
||||
android:duration="400"/>
|
||||
<rotate
|
||||
android:startOffset="1800"
|
||||
android:fromDegrees="0"
|
||||
android:toDegrees="50"
|
||||
android:pivotY="50%"
|
||||
android:pivotX="50%"
|
||||
android:duration="200" />
|
||||
|
||||
</set>
|
|
@ -0,0 +1,138 @@
|
|||
package com.github.jjobes.slidedatetimepicker;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.DatePicker.OnDateChangedListener;
|
||||
|
||||
import com.adins.mss.base.R;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* The fragment for the first page in the ViewPager that holds
|
||||
* the {@link CustomDatePicker}.
|
||||
*
|
||||
* @author jjobes
|
||||
*/
|
||||
public class DateFragment extends Fragment {
|
||||
private DateChangedListener mCallback;
|
||||
private CustomDatePicker mDatePicker;
|
||||
public DateFragment() {
|
||||
// Required empty public constructor for fragment.
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an instance of DateFragment with its bundle filled with the
|
||||
* constructor arguments. The values in the bundle are retrieved in
|
||||
* {@link #onCreateView()} below to properly initialize the DatePicker.
|
||||
*
|
||||
* @param theme
|
||||
* @param year
|
||||
* @param month
|
||||
* @param day
|
||||
* @param minDate
|
||||
* @param maxDate
|
||||
* @return an instance of DateFragment
|
||||
*/
|
||||
public static final DateFragment newInstance(int theme, int year, int month,
|
||||
int day, Date minDate, Date maxDate) {
|
||||
DateFragment f = new DateFragment();
|
||||
|
||||
Bundle b = new Bundle();
|
||||
b.putInt("theme", theme);
|
||||
b.putInt("year", year);
|
||||
b.putInt("month", month);
|
||||
b.putInt("day", day);
|
||||
b.putSerializable("minDate", minDate);
|
||||
b.putSerializable("maxDate", maxDate);
|
||||
f.setArguments(b);
|
||||
|
||||
return f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cast the reference to {@link SlideDateTimeDialogFragment}
|
||||
* to a {@link DateChangedListener}.
|
||||
*/
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
try {
|
||||
// mCallback = (DateChangedListener) getTargetFragment();
|
||||
mCallback = (DateChangedListener) getParentFragment();
|
||||
} catch (ClassCastException e) {
|
||||
throw new ClassCastException("Calling fragment must implement " +
|
||||
"DateFragment.DateChangedListener interface");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and return the user interface view for this fragment.
|
||||
*/
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
int theme = getArguments().getInt("theme");
|
||||
int initialYear = getArguments().getInt("year");
|
||||
int initialMonth = getArguments().getInt("month");
|
||||
int initialDay = getArguments().getInt("day");
|
||||
Date minDate = (Date) getArguments().getSerializable("minDate");
|
||||
Date maxDate = (Date) getArguments().getSerializable("maxDate");
|
||||
|
||||
// Unless we inflate using a cloned inflater with a Holo theme,
|
||||
// on Lollipop devices the DatePicker will be the new-style
|
||||
// DatePicker, which is not what we want. So we will
|
||||
// clone the inflater that we're given but with our specified
|
||||
// theme, then inflate the layout with this new inflater.
|
||||
|
||||
Context contextThemeWrapper = new ContextThemeWrapper(
|
||||
getActivity(),
|
||||
theme == SlideDateTimePicker.HOLO_DARK ?
|
||||
android.R.style.Theme_Holo :
|
||||
android.R.style.Theme_Holo_Light);
|
||||
|
||||
LayoutInflater localInflater = inflater.cloneInContext(contextThemeWrapper);
|
||||
|
||||
View v = localInflater.inflate(R.layout.fragment_date, container, false);
|
||||
|
||||
mDatePicker = (CustomDatePicker) v.findViewById(R.id.datePicker);
|
||||
// block keyboard popping up on touch
|
||||
mDatePicker.setDescendantFocusability(DatePicker.FOCUS_BLOCK_DESCENDANTS);
|
||||
mDatePicker.init(
|
||||
initialYear,
|
||||
initialMonth,
|
||||
initialDay,
|
||||
new OnDateChangedListener() {
|
||||
|
||||
@Override
|
||||
public void onDateChanged(DatePicker view, int year,
|
||||
int monthOfYear, int dayOfMonth) {
|
||||
mCallback.onDateChanged(year, monthOfYear, dayOfMonth);
|
||||
}
|
||||
});
|
||||
|
||||
if (minDate != null)
|
||||
mDatePicker.setMinDate(minDate.getTime());
|
||||
|
||||
if (maxDate != null)
|
||||
mDatePicker.setMaxDate(maxDate.getTime());
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to communicate back to the parent fragment as the user
|
||||
* is changing the date spinners so we can dynamically update
|
||||
* the tab text.
|
||||
*/
|
||||
public interface DateChangedListener {
|
||||
void onDateChanged(int year, int month, int day);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue