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,17 @@
|
|||
package com.adins.mss.svy.common;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
|
||||
/**
|
||||
* Created by Aditya Purwa on 3/4/2015.
|
||||
*/
|
||||
public class Dialogger {
|
||||
public static void error(Context context, Exception ex, String extraReason) {
|
||||
new AlertDialog.Builder(context)
|
||||
.setTitle("Error")
|
||||
.setMessage(ex.getMessage() + "\r\n" + extraReason)
|
||||
.create()
|
||||
.show();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,119 @@
|
|||
package com.adins.mss.main;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
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.svy.BuildConfig;
|
||||
import com.adins.mss.svy.NewMSMainActivity;
|
||||
import com.adins.mss.svy.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 dian.ina on 04/06/2015.
|
||||
*/
|
||||
|
||||
//@ReportsCrashes(
|
||||
// formUri = "http://app.ad-ins.com:5984/acra-demotest/_design/acra-storage/_update/report",
|
||||
// reportType = org.acra.sender.HttpSender.Type.JSON,
|
||||
// httpMethod = org.acra.sender.HttpSender.Method.PUT,
|
||||
// formUriBasicAuthLogin="admin",
|
||||
// formUriBasicAuthPassword="12345",
|
||||
// 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
|
||||
// },
|
||||
// mode = ReportingInteractionMode.TOAST,
|
||||
// resToastText = R.string.toast_crash
|
||||
//)
|
||||
|
||||
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");
|
||||
}
|
||||
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 NewMSMainActivity.class;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
|
||||
|
||||
</menu>
|
Binary file not shown.
After Width: | Height: | Size: 7 KiB |
|
@ -0,0 +1,41 @@
|
|||
package com.adins.mss.odr.accounts.adapter;
|
||||
|
||||
/**
|
||||
* Created by muhammad.aap on 11/30/2018.
|
||||
*/
|
||||
|
||||
public class LeadHistory {
|
||||
private String leadStatus;
|
||||
private String leadProduct;
|
||||
private String leadLastDate;
|
||||
|
||||
public LeadHistory(String leadStatus, String leadProduct, String leadLastDate) {
|
||||
this.leadStatus = leadStatus;
|
||||
this.leadProduct = leadProduct;
|
||||
this.leadLastDate = leadLastDate;
|
||||
}
|
||||
|
||||
public String getLeadStatus() {
|
||||
return leadStatus;
|
||||
}
|
||||
|
||||
public void setLeadStatus(String leadStatus) {
|
||||
this.leadStatus = leadStatus;
|
||||
}
|
||||
|
||||
public String getLeadProduct() {
|
||||
return leadProduct;
|
||||
}
|
||||
|
||||
public void setLeadProduct(String leadProduct) {
|
||||
this.leadProduct = leadProduct;
|
||||
}
|
||||
|
||||
public String getLeadLastDate() {
|
||||
return leadLastDate;
|
||||
}
|
||||
|
||||
public void setLeadLastDate(String leadLastDate) {
|
||||
this.leadLastDate = leadLastDate;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item android:id="@+id/mn_About"
|
||||
android:showAsAction="ifRoom"
|
||||
android:icon="@drawable/ic_approve"
|
||||
android:title="About"
|
||||
android:visible="true"
|
||||
android:enabled="true"
|
||||
/>
|
||||
<item android:id="@+id/mn_ServerLink"
|
||||
android:showAsAction="ifRoom"
|
||||
android:title="Server Link"
|
||||
android:icon="@drawable/ic_reject"
|
||||
android:visible="false"
|
||||
android:enabled="true"
|
||||
/>
|
||||
</menu>
|
|
@ -0,0 +1,158 @@
|
|||
package com.adins.mss.foundation.camera2;
|
||||
|
||||
import android.content.Context;
|
||||
import android.hardware.Sensor;
|
||||
import android.hardware.SensorEvent;
|
||||
import android.hardware.SensorEventListener;
|
||||
import android.hardware.SensorManager;
|
||||
import android.util.Log;
|
||||
import android.view.OrientationListener;
|
||||
|
||||
import com.adins.mss.foundation.camerainapp.helper.Logger;
|
||||
|
||||
/**
|
||||
* Created by ahmadkamilalmasyhur on 31/01/2018.
|
||||
*/
|
||||
|
||||
public abstract class OrientationEventListener {
|
||||
/**
|
||||
* Returned from onOrientationChanged when the device orientation cannot be determined
|
||||
* (typically when the device is in a close to flat position).
|
||||
*
|
||||
* @see #onOrientationChanged
|
||||
*/
|
||||
public static final int ORIENTATION_UNKNOWN = -1;
|
||||
private static final String TAG = "OrientationEventListener";
|
||||
private static final boolean DEBUG = false;
|
||||
private static final boolean localLOGV = false;
|
||||
private int mOrientation = ORIENTATION_UNKNOWN;
|
||||
private SensorManager mSensorManager;
|
||||
private boolean mEnabled = false;
|
||||
private int mRate;
|
||||
private Sensor mSensor;
|
||||
private SensorEventListener mSensorEventListener;
|
||||
private OrientationListener mOldListener;
|
||||
|
||||
/**
|
||||
* Creates a new OrientationEventListener.
|
||||
*
|
||||
* @param context for the OrientationEventListener.
|
||||
*/
|
||||
public OrientationEventListener(Context context) {
|
||||
this(context, SensorManager.SENSOR_DELAY_NORMAL);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new OrientationEventListener.
|
||||
*
|
||||
* @param context for the OrientationEventListener.
|
||||
* @param rate at which sensor events are processed (see also
|
||||
* {@link android.hardware.SensorManager SensorManager}). Use the default
|
||||
* value of {@link android.hardware.SensorManager#SENSOR_DELAY_NORMAL
|
||||
* SENSOR_DELAY_NORMAL} for simple screen orientation change detection.
|
||||
*/
|
||||
public OrientationEventListener(Context context, int rate) {
|
||||
mSensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
|
||||
mRate = rate;
|
||||
mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
|
||||
if (mSensor != null) {
|
||||
// Create listener only if sensors do exist
|
||||
mSensorEventListener = new SensorEventListenerImpl();
|
||||
}
|
||||
}
|
||||
|
||||
void registerListener(OrientationListener lis) {
|
||||
mOldListener = lis;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables the OrientationEventListener so it will monitor the sensor and call
|
||||
* {@link #onOrientationChanged} when the device orientation changes.
|
||||
*/
|
||||
public void enable() {
|
||||
if (mSensor == null) {
|
||||
Log.w(TAG, "Cannot detect sensors. Not enabled");
|
||||
return;
|
||||
}
|
||||
if (mEnabled == false) {
|
||||
Logger.d(TAG, "OrientationEventListener enabled");
|
||||
mSensorManager.registerListener(mSensorEventListener, mSensor, mRate);
|
||||
mEnabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables the OrientationEventListener.
|
||||
*/
|
||||
public void disable() {
|
||||
if (mSensor == null) {
|
||||
Logger.w(TAG, "Cannot detect sensors. Invalid disable");
|
||||
return;
|
||||
}
|
||||
if (mEnabled == true) {
|
||||
Logger.d(TAG, "OrientationEventListener disabled");
|
||||
mSensorManager.unregisterListener(mSensorEventListener);
|
||||
mEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns true if sensor is enabled and false otherwise
|
||||
*/
|
||||
public boolean canDetectOrientation() {
|
||||
return mSensor != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the orientation of the device has changed.
|
||||
* orientation parameter is in degrees, ranging from 0 to 359.
|
||||
* orientation is 0 degrees when the device is oriented in its natural position,
|
||||
* 90 degrees when its left side is at the top, 180 degrees when it is upside down,
|
||||
* and 270 degrees when its right side is to the top.
|
||||
* {@link #ORIENTATION_UNKNOWN} is returned when the device is close to flat
|
||||
* and the orientation cannot be determined.
|
||||
*
|
||||
* @param orientation The new orientation of the device.
|
||||
* @see #ORIENTATION_UNKNOWN
|
||||
*/
|
||||
abstract public void onOrientationChanged(int orientation);
|
||||
|
||||
class SensorEventListenerImpl implements SensorEventListener {
|
||||
private static final int _DATA_X = 0;
|
||||
private static final int _DATA_Y = 1;
|
||||
private static final int _DATA_Z = 2;
|
||||
|
||||
public void onSensorChanged(SensorEvent event) {
|
||||
float[] values = event.values;
|
||||
int orientation = ORIENTATION_UNKNOWN;
|
||||
float X = -values[_DATA_X];
|
||||
float Y = -values[_DATA_Y];
|
||||
float Z = -values[_DATA_Z];
|
||||
float magnitude = X * X + Y * Y;
|
||||
// Don't trust the angle if the magnitude is small compared to the y value
|
||||
if (magnitude * 4 >= Z * Z) {
|
||||
float OneEightyOverPi = 57.29577957855f;
|
||||
float angle = (float) Math.atan2(-Y, X) * OneEightyOverPi;
|
||||
orientation = 90 - (int) Math.round(angle);
|
||||
// normalize to 0 - 359 range
|
||||
while (orientation >= 360) {
|
||||
orientation -= 360;
|
||||
}
|
||||
while (orientation < 0) {
|
||||
orientation += 360;
|
||||
}
|
||||
}
|
||||
if (mOldListener != null) {
|
||||
mOldListener.onSensorChanged(Sensor.TYPE_ACCELEROMETER, event.values);
|
||||
}
|
||||
if (orientation != mOrientation) {
|
||||
mOrientation = orientation;
|
||||
onOrientationChanged(orientation);
|
||||
}
|
||||
}
|
||||
|
||||
public void onAccuracyChanged(Sensor sensor, int accuracy) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 6.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
|
@ -0,0 +1,53 @@
|
|||
package com.adins.mss.coll.models;
|
||||
|
||||
import com.adins.mss.foundation.http.MssRequestType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by adityapurwa on 11/03/15.
|
||||
*/
|
||||
public class SynchronizeRequestModel extends MssRequestType {
|
||||
@SerializedName("tableName")
|
||||
private String tableName;
|
||||
@SerializedName("dtm_upd")
|
||||
private Date dtm_upd;
|
||||
@SerializedName("list")
|
||||
private List list;
|
||||
@SerializedName("init")
|
||||
private int init;
|
||||
|
||||
public List getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public Date getDtm_upd() {
|
||||
return dtm_upd;
|
||||
}
|
||||
|
||||
public void setDtm_upd(Date dtm_upd) {
|
||||
this.dtm_upd = dtm_upd;
|
||||
}
|
||||
|
||||
public int getInit() {
|
||||
return init;
|
||||
}
|
||||
|
||||
public void setInit(int init) {
|
||||
this.init = init;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.adins.mss.coll;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.content.Context;
|
||||
|
||||
import com.adins.mss.base.todo.form.NewTaskActivity;
|
||||
import com.adins.mss.base.todo.form.NewTaskAdapter;
|
||||
import com.adins.mss.base.todolist.DoList;
|
||||
import com.adins.mss.dao.Scheme;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MCNewTaskActivity extends NewTaskActivity {
|
||||
|
||||
private DoList list;
|
||||
private List<Scheme> objects;
|
||||
|
||||
@Override
|
||||
public void onAttach(Context activity) {
|
||||
super.onAttach(activity);
|
||||
getActivity().getActionBar().setTitle(getString(R.string.title_mn_newtask));
|
||||
getActivity().getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected NewTaskAdapter getNewTaskAdapter() {
|
||||
// TODO Auto-generated method stub
|
||||
list = new DoList(getActivity());
|
||||
objects = list.getCollListScheme();
|
||||
|
||||
return new NewTaskAdapter(getActivity(), objects);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,348 @@
|
|||
package com.adins.mss.base.todolist.form;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ActionBar;
|
||||
import android.app.ActionBar.Tab;
|
||||
import android.app.ActionBar.TabListener;
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Filterable;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.SearchView;
|
||||
|
||||
import com.adins.mss.base.GlobalData;
|
||||
import com.adins.mss.base.R;
|
||||
import com.adins.mss.base.commons.FragmentHost;
|
||||
import com.adins.mss.base.crashlytics.FireCrash;
|
||||
import com.adins.mss.base.mainmenu.MainMenuActivity;
|
||||
import com.adins.mss.constant.Global;
|
||||
import com.adins.mss.foundation.dialog.NiftyDialogBuilder;
|
||||
|
||||
import org.acra.ACRA;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Locale;
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public class TaskList_Fragment extends Fragment implements
|
||||
TabListener, SearchView.OnQueryTextListener, FragmentHost {
|
||||
|
||||
public static String BUND_KEY_ISERROR = "isError";
|
||||
public static String BUND_KEY_MESSAGE = "message";
|
||||
public static String BUND_KEY_PAGE = "page";
|
||||
public static boolean isMenuClicked = false;
|
||||
private static Menu mainMenu;
|
||||
/**
|
||||
* The {@link androidx.viewpager.widget.PagerAdapter} that will provide
|
||||
* fragments for each of the sections. We use a
|
||||
* {@link androidx.fragment.app.FragmentPagerAdapter} derivative, which
|
||||
* will keep every loaded fragment in memory. If this becomes too memory
|
||||
* intensive, it may be best to switch to a
|
||||
* {@link androidx.fragment.app.FragmentStatePagerAdapter}.
|
||||
*/
|
||||
SectionsPagerAdapter mSectionsPagerAdapter;
|
||||
/**
|
||||
* The {@link ViewPager} that will host the section contents.
|
||||
*/
|
||||
ViewPager mViewPager;
|
||||
View view;
|
||||
private boolean isError = false;
|
||||
private String message;
|
||||
private Activity context;
|
||||
private Fragment activeFragment;
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
//EMPTY
|
||||
}
|
||||
|
||||
public void initialize(View view) {
|
||||
if (view instanceof LinearLayout) {
|
||||
mSectionsPagerAdapter = new SectionsPagerAdapter(
|
||||
getChildFragmentManager());
|
||||
ActionBar actionBar = getActivity().getActionBar();
|
||||
if (actionBar.getTabCount() != 0) actionBar.removeAllTabs();
|
||||
for (int i = 0; i < mSectionsPagerAdapter.getCount(); i++) {
|
||||
actionBar.addTab(actionBar.newTab()
|
||||
.setText(mSectionsPagerAdapter.getPageTitle(i))
|
||||
.setTabListener(this));
|
||||
}
|
||||
mViewPager = (ViewPager) view.findViewById(R.id.pager);
|
||||
mViewPager.setAdapter(mSectionsPagerAdapter);
|
||||
|
||||
mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
try {
|
||||
getActivity().getActionBar().setSelectedNavigationItem(position);
|
||||
} catch (IllegalStateException e) {
|
||||
FireCrash.log(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
if (isError) {
|
||||
NiftyDialogBuilder dialogBuilder = NiftyDialogBuilder.getInstance(getActivity());
|
||||
|
||||
if (!dialogBuilder.isShowing()) {
|
||||
dialogBuilder.withTitle("WARNING").
|
||||
withIcon(android.R.drawable.ic_dialog_alert).
|
||||
withMessage(message).isCancelable(true).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
view = inflater.inflate(R.layout.tasklist__layout, container, false);
|
||||
initialize(view);
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
setHasOptionsMenu(true);
|
||||
ACRA.getErrorReporter().putCustomData("LAST_CLASS_ACCESSED", getClass().getSimpleName());
|
||||
context = activity;
|
||||
try {
|
||||
isError = getArguments().getBoolean(TaskList_Fragment.BUND_KEY_ISERROR, false);
|
||||
message = getArguments().getString(TaskList_Fragment.BUND_KEY_MESSAGE, "");
|
||||
} catch (Exception e) {
|
||||
FireCrash.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPrepareOptionsMenu(Menu menu) {
|
||||
super.onPrepareOptionsMenu(menu);
|
||||
mainMenu = menu;
|
||||
menu.findItem(R.id.menuMore).setVisible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle item selection
|
||||
if (isMenuClicked == false) {
|
||||
int id = item.getItemId();
|
||||
if (id == R.id.menuMore) {
|
||||
mainMenu.findItem(R.id.mnViewAllHeader).setVisible(true);
|
||||
String application = GlobalData.getSharedGlobalData().getAuditData().getApplication();
|
||||
if (Global.APPLICATION_COLLECTION.equalsIgnoreCase(application))
|
||||
mainMenu.findItem(R.id.mnViewMap).setVisible(true);
|
||||
isMenuClicked = false;
|
||||
}
|
||||
if (id == R.id.mnViewMap) {
|
||||
MapsViewerFragment fragment = new MapsViewerFragment();
|
||||
FragmentTransaction transaction = MainMenuActivity.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();
|
||||
isMenuClicked = true;
|
||||
} else if (id == R.id.mnViewAllHeader) {
|
||||
AllHeaderViewerFragment viewerFragment = AllHeaderViewerFragment.newInstance(AllHeaderViewerFragment.REQ_PRIORITY_LIST);
|
||||
FragmentTransaction transaction = MainMenuActivity.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, viewerFragment);
|
||||
transaction.addToBackStack(null);
|
||||
transaction.commit();
|
||||
isMenuClicked = true;
|
||||
}
|
||||
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
isMenuClicked = false;
|
||||
getActivity().getActionBar().setTitle(getString(R.string.title_mn_tasklist));
|
||||
ActionBar actionBar = getActivity().getActionBar();
|
||||
if (actionBar.getTabCount() != 0) actionBar.removeAllTabs();
|
||||
for (int i = 0; i < mSectionsPagerAdapter.getCount(); i++) {
|
||||
actionBar.addTab(actionBar.newTab()
|
||||
.setText(mSectionsPagerAdapter.getPageTitle(i))
|
||||
.setTabListener(this));
|
||||
}
|
||||
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
final ActionBar actionBar = getActivity().getActionBar();
|
||||
actionBar.removeAllTabs();
|
||||
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
|
||||
final ActionBar actionBar = getActivity().getActionBar();
|
||||
actionBar.removeAllTabs();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetach() {
|
||||
final ActionBar actionBar = getActivity().getActionBar();
|
||||
actionBar.removeAllTabs();
|
||||
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
|
||||
super.onDetach();
|
||||
try {
|
||||
mainMenu.findItem(R.id.menuMore).setVisible(false);
|
||||
} catch (Exception e) {
|
||||
FireCrash.log(e);
|
||||
}
|
||||
try {
|
||||
Field childFragmentManager = Fragment.class.getDeclaredField("mChildFragmentManager");
|
||||
childFragmentManager.setAccessible(true);
|
||||
childFragmentManager.set(this, null);
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
final ActionBar actionBar = getActivity().getActionBar();
|
||||
actionBar.removeAllTabs();
|
||||
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
|
||||
super.onDestroyView();
|
||||
try {
|
||||
mainMenu.findItem(R.id.menuMore).setVisible(false);
|
||||
} catch (Exception e) {
|
||||
FireCrash.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
Filterable filterable = (Filterable) getActiveFragment();
|
||||
if (filterable != null) {
|
||||
filterable.getFilter().filter(newText);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getActiveFragment() {
|
||||
return activeFragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setActiveFragment(Fragment fragment) {
|
||||
activeFragment = fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(Tab tab, android.app.FragmentTransaction ft) {
|
||||
//EMPTY
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabSelected(Tab tab, android.app.FragmentTransaction ft) {
|
||||
mViewPager.setCurrentItem(tab.getPosition());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(Tab tab, android.app.FragmentTransaction ft) {
|
||||
//EMPTY
|
||||
}
|
||||
|
||||
/**
|
||||
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to
|
||||
* one of the sections/tabs/pages.
|
||||
*/
|
||||
public class SectionsPagerAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
public SectionsPagerAdapter(FragmentManager fm) {
|
||||
super(fm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
// getItem is called to instantiate the fragment for the given page.
|
||||
// Return a DummySectionFragment (defined as a static inner class
|
||||
// below) with the page number as its lone argument.
|
||||
Fragment fragment = null;
|
||||
switch (position) {
|
||||
case 0:
|
||||
fragment = new PrioritySectionFragment();
|
||||
break;
|
||||
case 1:
|
||||
fragment = new StatusSectionFragment();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return fragment;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
// Show 3 total pages.
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
Locale l = Locale.getDefault();
|
||||
switch (position) {
|
||||
case 0:
|
||||
return getString(R.string.title_priority).toUpperCase(l);
|
||||
case 1:
|
||||
return getString(R.string.title_status).toUpperCase(l);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getPageIcon(int position) {
|
||||
switch (position) {
|
||||
case 0:
|
||||
return R.drawable.icon_low;
|
||||
case 1:
|
||||
return R.drawable.icon_high;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getBakcgroundColor(int position) {
|
||||
switch (position) {
|
||||
case 0:
|
||||
return R.drawable.highpriority_background;
|
||||
case 1:
|
||||
return R.drawable.mediumpriority_background;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package com.adins.mss.base.syncfile;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.adins.mss.dao.MobileDataFile;
|
||||
|
||||
/**
|
||||
* Created by loise on 10/13/2017.
|
||||
*/
|
||||
|
||||
/**
|
||||
* class untuk menampung parameter untuk proses download file
|
||||
*/
|
||||
public class DownloadParams {
|
||||
|
||||
Context context;
|
||||
String outputfilepath;
|
||||
MobileDataFile metadata;
|
||||
String message;
|
||||
|
||||
public DownloadParams(String outputfilepath, Context context, String message, MobileDataFile metadata) {
|
||||
|
||||
this.context = context;
|
||||
this.outputfilepath = outputfilepath;
|
||||
this.message = message;
|
||||
this.metadata = metadata;
|
||||
}
|
||||
|
||||
public MobileDataFile getMetadata() {
|
||||
return metadata;
|
||||
}
|
||||
|
||||
public void setMetadata(MobileDataFile metadata) {
|
||||
this.metadata = metadata;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public Context getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public String getOutputfilepath() {
|
||||
return outputfilepath;
|
||||
}
|
||||
|
||||
public void setOutputfilepath(String outputfilepath) {
|
||||
this.outputfilepath = outputfilepath;
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
|
@ -0,0 +1,79 @@
|
|||
package com.adins.mss.coll.models;
|
||||
|
||||
/**
|
||||
* Created by Aditya Purwa on 3/4/2015.
|
||||
*/
|
||||
public class DepositReportRequestHeader {
|
||||
private String uuid_deposit_report_h;
|
||||
private String batch_id;
|
||||
private String account_bank;
|
||||
private String bank_name;
|
||||
private String cashier_name;
|
||||
private String transfered_date;
|
||||
private String dtm_crt;
|
||||
private String uuid_user;
|
||||
|
||||
public String getUuid_deposit_report_h() {
|
||||
return uuid_deposit_report_h;
|
||||
}
|
||||
|
||||
public void setUuid_deposit_report_h(String uuid_deposit_report_h) {
|
||||
this.uuid_deposit_report_h = uuid_deposit_report_h;
|
||||
}
|
||||
|
||||
public String getBatch_id() {
|
||||
return batch_id;
|
||||
}
|
||||
|
||||
public void setBatch_id(String batch_id) {
|
||||
this.batch_id = batch_id;
|
||||
}
|
||||
|
||||
public String getAccount_bank() {
|
||||
return account_bank;
|
||||
}
|
||||
|
||||
public void setAccount_bank(String account_bank) {
|
||||
this.account_bank = account_bank;
|
||||
}
|
||||
|
||||
public String getBank_name() {
|
||||
return bank_name;
|
||||
}
|
||||
|
||||
public void setBank_name(String bank_name) {
|
||||
this.bank_name = bank_name;
|
||||
}
|
||||
|
||||
public String getCashier_name() {
|
||||
return cashier_name;
|
||||
}
|
||||
|
||||
public void setCashier_name(String cashier_name) {
|
||||
this.cashier_name = cashier_name;
|
||||
}
|
||||
|
||||
public String getTransfered_date() {
|
||||
return transfered_date;
|
||||
}
|
||||
|
||||
public void setTransfered_date(String transfered_date) {
|
||||
this.transfered_date = transfered_date;
|
||||
}
|
||||
|
||||
public String getDtm_crt() {
|
||||
return dtm_crt;
|
||||
}
|
||||
|
||||
public void setDtm_crt(String dtm_crt) {
|
||||
this.dtm_crt = dtm_crt;
|
||||
}
|
||||
|
||||
public String getUuid_user() {
|
||||
return uuid_user;
|
||||
}
|
||||
|
||||
public void setUuid_user(String uuid_user) {
|
||||
this.uuid_user = uuid_user;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue