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,39 @@
|
|||
package com.adins.mss.base.models;
|
||||
|
||||
import com.adins.mss.foundation.http.MssRequestType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class SendUpdateNotificationRequest extends MssRequestType {
|
||||
|
||||
@SerializedName("uuid_user")
|
||||
private String uuidUser;
|
||||
@SerializedName("flag")
|
||||
private String flag;
|
||||
@SerializedName("uuidNotification")
|
||||
private String uuidNotification;
|
||||
|
||||
public String getUuidUser() {
|
||||
return uuidUser;
|
||||
}
|
||||
|
||||
public void setUuidUser(String uuidUser) {
|
||||
this.uuidUser = uuidUser;
|
||||
}
|
||||
|
||||
public String getFlag() {
|
||||
return flag;
|
||||
}
|
||||
|
||||
public void setFlag(String flag) {
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
public String getUuidNotification() {
|
||||
return uuidNotification;
|
||||
}
|
||||
|
||||
public void setUuidNotification(String uuidNotification) {
|
||||
this.uuidNotification = uuidNotification;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.adins.mss.foundation.dialog.gitonway.lib.effects;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import com.adins.libs.nineoldandroids.animation.ObjectAnimator;
|
||||
|
||||
/*
|
||||
* Copyright 2014 litao
|
||||
* https://github.com/sd6352051/NiftyDialogEffects
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
public class SideFall extends BaseEffects {
|
||||
|
||||
@Override
|
||||
protected void setupAnimation(View view) {
|
||||
getAnimatorSet().playTogether(
|
||||
ObjectAnimator.ofFloat(view, "scaleX", 2, 1.5f, 1).setDuration(mDuration),
|
||||
ObjectAnimator.ofFloat(view, "scaleY", 2, 1.5f, 1).setDuration(mDuration),
|
||||
ObjectAnimator.ofFloat(view, "rotation", 25, 0).setDuration(mDuration),
|
||||
ObjectAnimator.ofFloat(view, "translationX", 80, 0).setDuration(mDuration),
|
||||
ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(mDuration * 3 / 2)
|
||||
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,130 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources translatable="false">
|
||||
|
||||
<string name="define_license_Apache_2_0"></string>
|
||||
<string name="license_Apache_2_0_licenseName">Apache Version 2.0</string>
|
||||
<string name="license_Apache_2_0_licenseWebsite">http://www.apache.org/licenses/LICENSE-2.0.html</string>
|
||||
<string name="license_Apache_2_0_licenseShortDescription">
|
||||
<![CDATA[
|
||||
Copyright © <<<YEAR>>>, <<<OWNER>>>
|
||||
<br />
|
||||
All rights reserved.
|
||||
<br /><br />
|
||||
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
|
||||
<br /><br />
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
<br /><br />
|
||||
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.
|
||||
]]>
|
||||
</string>
|
||||
<string name="license_Apache_2_0_licenseDescription">
|
||||
<![CDATA[
|
||||
Copyright © <<<YEAR>>>, <<<OWNER>>>
|
||||
<br />
|
||||
All rights reserved.
|
||||
<br /><br />
|
||||
<b>TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION</b>
|
||||
<br /><br />
|
||||
<b>1. Definitions.</b>
|
||||
<br /><br />
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
<br /><br />
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
<br /><br />
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that
|
||||
entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity,
|
||||
whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such
|
||||
entity.
|
||||
<br /><br />
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
<br /><br />
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and
|
||||
configuration files.
|
||||
<br /><br />
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object
|
||||
code, generated documentation, and conversions to other media types.
|
||||
<br /><br />
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is
|
||||
included in or attached to the work (an example is provided in the Appendix below).
|
||||
<br /><br />
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial
|
||||
revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License,
|
||||
Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative
|
||||
Works thereof.
|
||||
<br /><br />
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or
|
||||
Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal
|
||||
Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or
|
||||
written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code
|
||||
control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||
<br /><br />
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently
|
||||
incorporated within the Work.
|
||||
<br /><br />
|
||||
<b>2. Grant of Copyright License.</b> Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide,
|
||||
non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform,
|
||||
sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
<br /><br />
|
||||
<b>3. Grant of Patent License.</b> Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide,
|
||||
non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell,
|
||||
import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily
|
||||
infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution
|
||||
incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that
|
||||
Work shall terminate as of the date such litigation is filed.
|
||||
<br /><br />
|
||||
<b>4. Redistribution.</b> You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in
|
||||
Source or Object form, provided that You meet the following conditions:
|
||||
<br /><br />
|
||||
You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the
|
||||
Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the
|
||||
attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided
|
||||
along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The
|
||||
contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within
|
||||
Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices
|
||||
cannot be construed as modifying the License.
|
||||
<br />
|
||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use,
|
||||
reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of
|
||||
the Work otherwise complies with the conditions stated in this License.
|
||||
<br /><br />
|
||||
<b>5. Submission of Contributions.</b> Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the
|
||||
Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein
|
||||
shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
<br /><br />
|
||||
<b>6. Trademarks.</b> This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as
|
||||
required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
<br /><br />
|
||||
<b>7. Disclaimer of Warranty.</b> Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its
|
||||
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any
|
||||
warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining
|
||||
the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
<br /><br />
|
||||
<b>8. Limitation of Liability.</b> In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by
|
||||
applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including
|
||||
any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability
|
||||
to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other
|
||||
commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
<br /><br />
|
||||
<b>9. Accepting Warranty or Additional Liability.</b> While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for,
|
||||
acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such
|
||||
obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to
|
||||
indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your
|
||||
accepting any such warranty or additional liability.
|
||||
<br /><br />
|
||||
<b>END OF TERMS AND CONDITIONS</b>
|
||||
]]>
|
||||
</string>
|
||||
|
||||
</resources>
|
|
@ -0,0 +1,266 @@
|
|||
package com.adins.mss.dao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import android.database.Cursor;
|
||||
|
||||
import de.greenrobot.dao.AbstractDao;
|
||||
import de.greenrobot.dao.Property;
|
||||
import de.greenrobot.dao.internal.SqlUtils;
|
||||
import de.greenrobot.dao.internal.DaoConfig;
|
||||
import de.greenrobot.dao.database.Database;
|
||||
import de.greenrobot.dao.database.DatabaseStatement;
|
||||
import de.greenrobot.dao.query.Query;
|
||||
import de.greenrobot.dao.query.QueryBuilder;
|
||||
|
||||
import com.adins.mss.dao.CollectionHistory;
|
||||
|
||||
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
|
||||
/**
|
||||
* DAO for table "TR_COLLECTIONHISTORY".
|
||||
*/
|
||||
public class CollectionHistoryDao extends AbstractDao<CollectionHistory, String> {
|
||||
|
||||
public static final String TABLENAME = "TR_COLLECTIONHISTORY";
|
||||
|
||||
/**
|
||||
* Properties of entity CollectionHistory.<br/>
|
||||
* Can be used for QueryBuilder and for referencing column names.
|
||||
*/
|
||||
public static class Properties {
|
||||
public final static Property Uuid_collection_history = new Property(0, String.class, "uuid_collection_history", true, "UUID_COLLECTION_HISTORY");
|
||||
public final static Property Last_update = new Property(1, java.util.Date.class, "last_update", false, "LAST_UPDATE");
|
||||
public final static Property Description = new Property(2, String.class, "description", false, "DESCRIPTION");
|
||||
public final static Property Usr_crt = new Property(3, String.class, "usr_crt", false, "USR_CRT");
|
||||
public final static Property Dtm_crt = new Property(4, java.util.Date.class, "dtm_crt", false, "DTM_CRT");
|
||||
public final static Property Uuid_user = new Property(5, String.class, "uuid_user", false, "UUID_USER");
|
||||
};
|
||||
|
||||
private DaoSession daoSession;
|
||||
|
||||
private Query<CollectionHistory> user_CollectionHistoryListQuery;
|
||||
|
||||
public CollectionHistoryDao(DaoConfig config) {
|
||||
super(config);
|
||||
}
|
||||
|
||||
public CollectionHistoryDao(DaoConfig config, DaoSession daoSession) {
|
||||
super(config, daoSession);
|
||||
this.daoSession = daoSession;
|
||||
}
|
||||
|
||||
/** Creates the underlying database table. */
|
||||
public static void createTable(Database db, boolean ifNotExists) {
|
||||
String constraint = ifNotExists? "IF NOT EXISTS ": "";
|
||||
db.execSQL("CREATE TABLE " + constraint + "\"TR_COLLECTIONHISTORY\" (" + //
|
||||
"\"UUID_COLLECTION_HISTORY\" TEXT PRIMARY KEY NOT NULL ," + // 0: uuid_collection_history
|
||||
"\"LAST_UPDATE\" INTEGER," + // 1: last_update
|
||||
"\"DESCRIPTION\" TEXT," + // 2: description
|
||||
"\"USR_CRT\" TEXT," + // 3: usr_crt
|
||||
"\"DTM_CRT\" INTEGER," + // 4: dtm_crt
|
||||
"\"UUID_USER\" TEXT);"); // 5: uuid_user
|
||||
}
|
||||
|
||||
/** Drops the underlying database table. */
|
||||
public static void dropTable(Database db, boolean ifExists) {
|
||||
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"TR_COLLECTIONHISTORY\"";
|
||||
db.execSQL(sql);
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
protected void bindValues(DatabaseStatement stmt, CollectionHistory entity) {
|
||||
stmt.clearBindings();
|
||||
stmt.bindString(1, entity.getUuid_collection_history());
|
||||
|
||||
java.util.Date last_update = entity.getLast_update();
|
||||
if (last_update != null) {
|
||||
stmt.bindLong(2, last_update.getTime());
|
||||
}
|
||||
|
||||
String description = entity.getDescription();
|
||||
if (description != null) {
|
||||
stmt.bindString(3, description);
|
||||
}
|
||||
|
||||
String usr_crt = entity.getUsr_crt();
|
||||
if (usr_crt != null) {
|
||||
stmt.bindString(4, usr_crt);
|
||||
}
|
||||
|
||||
java.util.Date dtm_crt = entity.getDtm_crt();
|
||||
if (dtm_crt != null) {
|
||||
stmt.bindLong(5, dtm_crt.getTime());
|
||||
}
|
||||
|
||||
String uuid_user = entity.getUuid_user();
|
||||
if (uuid_user != null) {
|
||||
stmt.bindString(6, uuid_user);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachEntity(CollectionHistory entity) {
|
||||
super.attachEntity(entity);
|
||||
entity.__setDaoSession(daoSession);
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
public String readKey(Cursor cursor, int offset) {
|
||||
return cursor.getString(offset + 0);
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
public CollectionHistory readEntity(Cursor cursor, int offset) {
|
||||
CollectionHistory entity = new CollectionHistory( //
|
||||
cursor.getString(offset + 0), // uuid_collection_history
|
||||
cursor.isNull(offset + 1) ? null : new java.util.Date(cursor.getLong(offset + 1)), // last_update
|
||||
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // description
|
||||
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // usr_crt
|
||||
cursor.isNull(offset + 4) ? null : new java.util.Date(cursor.getLong(offset + 4)), // dtm_crt
|
||||
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // uuid_user
|
||||
);
|
||||
return entity;
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
public void readEntity(Cursor cursor, CollectionHistory entity, int offset) {
|
||||
entity.setUuid_collection_history(cursor.getString(offset + 0));
|
||||
entity.setLast_update(cursor.isNull(offset + 1) ? null : new java.util.Date(cursor.getLong(offset + 1)));
|
||||
entity.setDescription(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
|
||||
entity.setUsr_crt(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
|
||||
entity.setDtm_crt(cursor.isNull(offset + 4) ? null : new java.util.Date(cursor.getLong(offset + 4)));
|
||||
entity.setUuid_user(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
protected String updateKeyAfterInsert(CollectionHistory entity, long rowId) {
|
||||
return entity.getUuid_collection_history();
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
public String getKey(CollectionHistory entity) {
|
||||
if(entity != null) {
|
||||
return entity.getUuid_collection_history();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
@Override
|
||||
protected boolean isEntityUpdateable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Internal query to resolve the "collectionHistoryList" to-many relationship of User. */
|
||||
public List<CollectionHistory> _queryUser_CollectionHistoryList(String uuid_user) {
|
||||
synchronized (this) {
|
||||
if (user_CollectionHistoryListQuery == null) {
|
||||
QueryBuilder<CollectionHistory> queryBuilder = queryBuilder();
|
||||
queryBuilder.where(Properties.Uuid_user.eq(null));
|
||||
user_CollectionHistoryListQuery = queryBuilder.build();
|
||||
}
|
||||
}
|
||||
Query<CollectionHistory> query = user_CollectionHistoryListQuery.forCurrentThread();
|
||||
query.setParameter(0, uuid_user);
|
||||
return query.list();
|
||||
}
|
||||
|
||||
private String selectDeep;
|
||||
|
||||
protected String getSelectDeep() {
|
||||
if (selectDeep == null) {
|
||||
StringBuilder builder = new StringBuilder("SELECT ");
|
||||
SqlUtils.appendColumns(builder, "T", getAllColumns());
|
||||
builder.append(',');
|
||||
SqlUtils.appendColumns(builder, "T0", daoSession.getUserDao().getAllColumns());
|
||||
builder.append(" FROM TR_COLLECTIONHISTORY T");
|
||||
builder.append(" LEFT JOIN MS_USER T0 ON T.\"UUID_USER\"=T0.\"UUID_USER\"");
|
||||
builder.append(' ');
|
||||
selectDeep = builder.toString();
|
||||
}
|
||||
return selectDeep;
|
||||
}
|
||||
|
||||
protected CollectionHistory loadCurrentDeep(Cursor cursor, boolean lock) {
|
||||
CollectionHistory entity = loadCurrent(cursor, 0, lock);
|
||||
int offset = getAllColumns().length;
|
||||
|
||||
User user = loadCurrentOther(daoSession.getUserDao(), cursor, offset);
|
||||
entity.setUser(user);
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public CollectionHistory loadDeep(Long key) {
|
||||
assertSinglePk();
|
||||
if (key == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
StringBuilder builder = new StringBuilder(getSelectDeep());
|
||||
builder.append("WHERE ");
|
||||
SqlUtils.appendColumnsEqValue(builder, "T", getPkColumns());
|
||||
String sql = builder.toString();
|
||||
|
||||
String[] keyArray = new String[] { key.toString() };
|
||||
Cursor cursor = db.rawQuery(sql, keyArray);
|
||||
|
||||
try {
|
||||
boolean available = cursor.moveToFirst();
|
||||
if (!available) {
|
||||
return null;
|
||||
} else if (!cursor.isLast()) {
|
||||
throw new IllegalStateException("Expected unique result, but count was " + cursor.getCount());
|
||||
}
|
||||
return loadCurrentDeep(cursor, true);
|
||||
} finally {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
|
||||
/** Reads all available rows from the given cursor and returns a list of new ImageTO objects. */
|
||||
public List<CollectionHistory> loadAllDeepFromCursor(Cursor cursor) {
|
||||
int count = cursor.getCount();
|
||||
List<CollectionHistory> list = new ArrayList<CollectionHistory>(count);
|
||||
|
||||
if (cursor.moveToFirst()) {
|
||||
if (identityScope != null) {
|
||||
identityScope.lock();
|
||||
identityScope.reserveRoom(count);
|
||||
}
|
||||
try {
|
||||
do {
|
||||
list.add(loadCurrentDeep(cursor, false));
|
||||
} while (cursor.moveToNext());
|
||||
} finally {
|
||||
if (identityScope != null) {
|
||||
identityScope.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
protected List<CollectionHistory> loadDeepAllAndCloseCursor(Cursor cursor) {
|
||||
try {
|
||||
return loadAllDeepFromCursor(cursor);
|
||||
} finally {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** A raw-style query where you can pass any WHERE clause and arguments. */
|
||||
public List<CollectionHistory> queryDeep(String where, String... selectionArg) {
|
||||
Cursor cursor = db.rawQuery(getSelectDeep() + where, selectionArg);
|
||||
return loadDeepAllAndCloseCursor(cursor);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical" >
|
||||
<View
|
||||
android:id="@+id/actionbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:background="@drawable/actionbar_background" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/contentComment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_margin="6dp"
|
||||
android:text="@string/profile__title" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout1"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="6dp"
|
||||
android:layout_marginRight="6dp" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/profilePicture"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_margin="6dp"
|
||||
android:layout_marginLeft="32dp"
|
||||
android:src="@drawable/profile_image" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnChangeProfile"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="31dp"
|
||||
android:text="@string/btnChange" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="6dp"
|
||||
android:text="@string/header__title"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout2"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="6dp"
|
||||
android:layout_marginRight="6dp" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/headerPicture"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/dummy" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnChangeHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="24dp"
|
||||
android:text="@string/btnChange" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
|
@ -0,0 +1,182 @@
|
|||
package com.adins.mss.foundation.db.dataaccess;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.adins.mss.dao.DaoSession;
|
||||
import com.adins.mss.dao.PaymentHistoryH;
|
||||
import com.adins.mss.dao.PaymentHistoryHDao;
|
||||
import com.adins.mss.foundation.db.DaoOpenHelper;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import de.greenrobot.dao.query.QueryBuilder;
|
||||
|
||||
public class PaymentHistoryHDataAccess {
|
||||
private PaymentHistoryHDataAccess() {
|
||||
}
|
||||
|
||||
/**
|
||||
* use to generate dao session that you can access modelDao
|
||||
*
|
||||
* @param context --> context from activity
|
||||
* @return
|
||||
*/
|
||||
protected static DaoSession getDaoSession(Context context) {
|
||||
return DaoOpenHelper.getDaoSession(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* get paymentHistory dao and you can access the DB
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
protected static PaymentHistoryHDao getPaymentHistoryDao(Context context) {
|
||||
return getDaoSession(context).getPaymentHistoryHDao();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear session, close db and set daoOpenHelper to null
|
||||
*/
|
||||
public static void closeAll() {
|
||||
DaoOpenHelper.closeAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* add paymentHistory as entity
|
||||
*
|
||||
* @param context
|
||||
* @param paymentHistoryH
|
||||
*/
|
||||
public static void add(Context context, PaymentHistoryH paymentHistoryH) {
|
||||
getPaymentHistoryDao(context).insert(paymentHistoryH);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* add paymentHistory as list entity
|
||||
*
|
||||
* @param context
|
||||
* @param paymentHistoryHList
|
||||
*/
|
||||
public static void add(Context context, List<PaymentHistoryH> paymentHistoryHList) {
|
||||
getPaymentHistoryDao(context).insertInTx(paymentHistoryHList);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* delete all content in table.
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
public static void clean(Context context) {
|
||||
getPaymentHistoryDao(context).deleteAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param paymentHistoryH
|
||||
*/
|
||||
public static void delete(Context context, PaymentHistoryH paymentHistoryH) {
|
||||
getPaymentHistoryDao(context).delete(paymentHistoryH);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* delete data by uuidTaskH
|
||||
*
|
||||
* @param context
|
||||
* @param uuidTaskH
|
||||
*/
|
||||
public static void delete(Context context, String uuidTaskH) {
|
||||
QueryBuilder<PaymentHistoryH> qb = getPaymentHistoryDao(context).queryBuilder();
|
||||
qb.where(PaymentHistoryHDao.Properties.Uuid_task_h.eq(uuidTaskH));
|
||||
qb.build();
|
||||
if (!qb.list().isEmpty()) {
|
||||
getPaymentHistoryDao(context).deleteInTx(qb.list());
|
||||
}
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param paymentHistoryH
|
||||
*/
|
||||
public static void updatePaymentHistory(Context context, PaymentHistoryH paymentHistoryH) {
|
||||
getPaymentHistoryDao(context).update(paymentHistoryH);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* get all data by agreementNo
|
||||
*
|
||||
* @param context
|
||||
* @param agreementNo
|
||||
* @return
|
||||
*/
|
||||
public static List<PaymentHistoryH> getAll(Context context, String agreementNo) {
|
||||
QueryBuilder<PaymentHistoryH> qb = getPaymentHistoryDao(context).queryBuilder();
|
||||
qb.where(PaymentHistoryHDao.Properties.Agreement_no.eq(agreementNo));
|
||||
qb.build();
|
||||
if (qb.list() != null) {
|
||||
if (!qb.list().isEmpty()) {
|
||||
return qb.list();
|
||||
}
|
||||
return Collections.emptyList();
|
||||
} else return Collections.emptyList();
|
||||
}
|
||||
|
||||
public static List<PaymentHistoryH> getAllbyTask(Context context, String uuidTaskH) {
|
||||
QueryBuilder<PaymentHistoryH> qb = getPaymentHistoryDao(context).queryBuilder();
|
||||
qb.where(PaymentHistoryHDao.Properties.Uuid_task_h.eq(uuidTaskH));
|
||||
qb.build();
|
||||
if (qb.list() != null) {
|
||||
if (!qb.list().isEmpty()) {
|
||||
return qb.list();
|
||||
}
|
||||
return Collections.emptyList();
|
||||
} else return Collections.emptyList();
|
||||
}
|
||||
|
||||
public static void addOrReplace(Context context, PaymentHistoryH paymentHistoryH) {
|
||||
if (getOnePH(context, paymentHistoryH.getUuid_payment_history_h()) != null)
|
||||
update(context, paymentHistoryH);
|
||||
else
|
||||
add(context, paymentHistoryH);
|
||||
}
|
||||
|
||||
public static void addOrReplace(Context context, List<PaymentHistoryH> paymentHistoryHList) {
|
||||
getPaymentHistoryDao(context).insertOrReplaceInTx(paymentHistoryHList);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
public static void update(Context context, PaymentHistoryH paymentHistoryH) {
|
||||
getPaymentHistoryDao(context).update(paymentHistoryH);
|
||||
getDaoSession(context).clear();
|
||||
}
|
||||
|
||||
public static PaymentHistoryH getOne(Context context, String uuid_task_h) {
|
||||
QueryBuilder<PaymentHistoryH> qb = getPaymentHistoryDao(context).queryBuilder();
|
||||
qb.where(PaymentHistoryHDao.Properties.Uuid_task_h.eq(uuid_task_h));
|
||||
qb.build();
|
||||
if (qb.list().isEmpty())
|
||||
return null;
|
||||
return qb.list().get(0);
|
||||
}
|
||||
|
||||
public static PaymentHistoryH getOnePH(Context context, String uuid_paymentHistoryH) {
|
||||
QueryBuilder<PaymentHistoryH> qb = getPaymentHistoryDao(context).queryBuilder();
|
||||
qb.where(PaymentHistoryHDao.Properties.Uuid_payment_history_h.eq(uuid_paymentHistoryH));
|
||||
qb.build();
|
||||
if (qb.list().isEmpty())
|
||||
return null;
|
||||
return qb.list().get(0);
|
||||
}
|
||||
/**
|
||||
* select paymentHistory per
|
||||
*
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.adins.mss.foundation.print.rv.syncs;
|
||||
|
||||
import com.adins.mss.dao.ReceiptVoucher;
|
||||
import com.adins.mss.foundation.http.MssResponseType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by angga.permadi on 5/10/2016.
|
||||
*/
|
||||
public class SyncRVResponse extends MssResponseType {
|
||||
@SerializedName("errorMessage")
|
||||
private String errorMessage;
|
||||
@SerializedName("listRvNumber")
|
||||
private List<ReceiptVoucher> listReceiptVoucher;
|
||||
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
|
||||
public void setErrorMessage(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
public List<ReceiptVoucher> getListReceiptVoucher() {
|
||||
return listReceiptVoucher;
|
||||
}
|
||||
|
||||
public void setListReceiptVoucher(List<ReceiptVoucher> listReceiptVoucher) {
|
||||
this.listReceiptVoucher = listReceiptVoucher;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.adins.mss.coll.services;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import com.adins.mss.foundation.security.storepreferences.ObscuredSharedPreferences;
|
||||
import com.services.ForegroundServiceNotification;
|
||||
|
||||
public class RestartAutoSendLocationReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Log.i(getClass().getSimpleName(), "Received message to restart service Tracking History");
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||
return;
|
||||
|
||||
ObscuredSharedPreferences sharedPref = ObscuredSharedPreferences.getPrefs(context,
|
||||
"GlobalData", Context.MODE_PRIVATE);
|
||||
boolean hasLogged = sharedPref.getBoolean("HAS_LOGGED", false);
|
||||
String manufacture = Build.MANUFACTURER.toLowerCase();
|
||||
if (!ForegroundServiceNotification.isServiceAvailable(context, MCLocationTrackingService.class)
|
||||
&& hasLogged) {
|
||||
switch (manufacture) {
|
||||
case "oppo":
|
||||
case "vivo":
|
||||
context.startService(new Intent(context, MCLocationTrackingService.class));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue