Commit 7d2275b9 by Lee Jaebin

要らないメソッド削除

parent 806fd2b1
......@@ -132,20 +132,6 @@ public class MediaInfoJSON extends AbstractJSON {
}
/** ENQUETE_TYPE
* @return displayFileName
*/
public String getDisplayFileName() {
return root.getString("displayFileNmae");
}
/** ENQUETE_TYPE
* @return objectName
*/
public String getObjectName() { // null可
return JsonUtil.getString(root, "objectName");
}
public Long getResourceId() { // -1可
return JsonUtil.getLong(root, "resourceId");
}
......
......@@ -87,52 +87,5 @@ public abstract class AbstractAcmsLoginParameters extends HttpParameterObject {
public String getPassword() {
return password;
}
/**
* アプリケーションIDを取得します。
* @return アプリケーションID
* @since 1.0.0
*/
public int getAppId() {
return appId;
}
/**
* アプリケーションの現在バージョンを取得します。
* @return アプリケーションの現在バージョンです。
* @since 1.0.0
*/
public String getAppVersion() {
return appVersion;
}
/**
* 端末タイプを返します。
* @return 端末タイプです。
* @since 1.0.0
*/
public int getDeviceTypeId() {
return deviceTypeId;
}
/**
* デバイストークンを取得します。
* @return デバイストークンです。
* @since 1.0.0
*/
public String getDeviceToken() {
return deviceToken;
}
/**
* 端末のMACアドレスを取得します。
* @return 端末のMACアドレスです。
* @since 1.0.0
*/
public String getMa() {
return ma;
}
/**
* システムの言語コードを返します。
* @since 1.1.0
*/
public String getLanguage() {
return Locale.getDefault().getLanguage();
}
}
......@@ -47,36 +47,4 @@ public class MobileLoginParameters extends HttpParameterObject {
this.udid = udid;
this.deviceTypeId = deviceTypeId;
}
/**
* ユーザのログインIDを指定します。
* @return ユーザのログインIDです。
* @since 1.0.0
*/
public String getLoginId() {
return loginId;
}
/**
* ユーザのパスワードを取得します。
* @return ユーザのパスワードです。
* @since 1.0.0
*/
public String getPassword() {
return password;
}
/**
* 端末の一意IDを取得します。
* @return 端末の一意IDです。
* @since 1.0.0
*/
public String getUdid() {
return udid;
}
/**
* 端末タイプを返します。
* @return 端末タイプです。
* @since 1.0.0
*/
public int getDeviceTypeId() {
return deviceTypeId;
}
}
......@@ -62,9 +62,7 @@ public class ABookKeys {
public static final String SUCCESS_FLG = "successFlg";
public static final String CMD = "cmd";
public static final String DATA = "data";
public static final String FILE_NAME = "filename";
public static final String TEMP = "temp";
public static final String IMAGE = "image";
public static final String VIDEO = "video";
......@@ -101,20 +99,13 @@ public class ABookKeys {
public static final String MOVEPAGE = "/abookmovepage";
public static final String DETAILLOG = "/abookdetaillog";
public static final String CONTENTLINK = "/abookcontentlink";
public static final String NEXTCONTENT = "/abooknextcontent";
public static final String SEND_CUSTOM_LOG = "/abooksendcustomlog";
public static final String GETITS_OPEN_SHARE = "/abookopengetitsshare";
public static final String PING = "/ping";
public static final String CMD_GETITS_OPEN_SHARE = "opengetitsshare";
public static final String CMD_GETITS_CLOSE_SHARE = "closegetitsshare";
public static final String PARAM_LAST_PAGE_NUMBER = "lastPageNo";
public static final String PARAM_LAST_PAGE_START_DATE = "lastPageStartDate";
public static final String PARAM_READING_LOG_ID = "readingLogId";
public static final String PARAM_SHARE_URL = "shareUrl";
public static final String URI = "uri";
public static final String CLOSE = "CLOSE";
public static final String OK = "OK";
}
......@@ -95,32 +95,6 @@ public class AbstractDao {
}
return db.delete(table, whereClause, whereArgs);
}
/**
* 指定したsql(insert文)を実行します。<br>
* 発行されたIDを返却します。
*
* ★重要: bind()メソッドを使用しないので、Dateを用いる場合は自前でUTCに変換すること
*
* @param sql
* @param bindArgs
* @return
* @throws Exception
*/
protected long execInsert(String sql, Object... bindArgs) {
SQLiteDatabase db = dbConn.getDatabase();
SQLiteStatement stmt = db.compileStatement(sql);
try {
if (Logger.isVerboseEnabled()) {
Logger.v(TAG, "%s [%s]", sql, join(bindArgs));
}
bind(stmt, bindArgs);
return stmt.executeInsert();
}
finally {
stmt.close();
}
}
/**
......
......@@ -148,10 +148,6 @@ public class InspectTaskReportDao extends AbstractDao {
}
}
public InspectTaskReportDto getInspectTaskReport(String taskKey, int taskReportId, String reportStartDate){
return rawQueryGetDto("select * from t_inspect_task_report where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)", new String[]{ taskKey, "" + taskReportId, reportStartDate }, InspectTaskReportDto.class);
}
public InspectTaskReportDto getInspectTaskReportUtc(String taskKey, int taskReportId, String reportStartDate){
return rawQueryGetDto("select * from t_inspect_task_report where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?, 'utc')", new String[]{ taskKey, "" + taskReportId, reportStartDate }, InspectTaskReportDto.class);
}
......@@ -160,10 +156,6 @@ public class InspectTaskReportDao extends AbstractDao {
return rawQueryGetDtoList("select * from t_inspect_task_report where task_key=?", new String[]{ taskKey }, InspectTaskReportDto.class);
}
public List<InspectTaskReportDto> selectInspectTaskReport(String taskKey, int taskReportId, String reportStartDate) {
return rawQueryGetDtoList("select * from t_inspect_task_report where task_key=? and task_report_id=? and datetime(report_start_date)=datetime(?)", new String[]{ taskKey, "" + taskReportId, reportStartDate }, InspectTaskReportDto.class);
}
public List<InspectTaskReportDto> getInspectTaskReportByProjectId(Long projectId) {
StringBuilder sb = new StringBuilder();
sb.append(" select tr.* ");
......@@ -206,19 +198,6 @@ public class InspectTaskReportDao extends AbstractDao {
return getSendableInspectTaskReportData(projectId).size() > 0;
}
public List<InspectTaskReportDto> getCurrentInspectTaskReportData(long projectId) {
String currDate = DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMddHHmmss_hyphen);
StringBuilder sb = new StringBuilder();
sb.append(" select tr.* ");
sb.append(" from t_inspect_task_report tr ");
sb.append(" inner join t_task tt ON tt.task_key == tr.task_key ");
sb.append(" WHERE tt.del_flg = 0 ");
sb.append(" AND tt.project_id = ? ");
sb.append(" AND datetime(report_start_date) <= datetime(?) ");
sb.append(" AND datetime(report_end_date) > datetime(?) ");
return rawQueryGetDtoList(sb.toString(), new String[]{ "" + projectId, currDate, currDate }, InspectTaskReportDto.class);
}
public boolean existsToDoInspectTaskReportData(long projectId) {
String currDate = DateTimeUtil.toString(DateTimeUtil.getCurrentSqlDate(), DateTimeFormat.yyyyMMddHHmmss_hyphen);
StringBuilder sb = new StringBuilder();
......
......@@ -3,5 +3,4 @@ package jp.agentec.abook.abv.bl.dto;
public class HelpDisplayInfoDto {
public String helpDescription;
public int resourceId;
public long contentId;
}
......@@ -47,30 +47,5 @@ public class MemberInfoDto extends AbstractDto {
public void setLastChangePasswordDate(Date lastChangePasswordDate) {
this.lastChangePasswordDate = lastChangePasswordDate;
// this.passwordExpiryDate = DateTimeUtil.add(lastChangePasswordDate, DateUnit.Day, ABVEnvironment.PasswordExpiryDate);
}
public Date getPasswordExpiryDate() {
if (passwordExpiryDate == null) {
passwordExpiryDate = DateTimeUtil.add(lastChangePasswordDate, DateUnit.Day, ABVEnvironment.PasswordExpiryDate);
}
return passwordExpiryDate;
}
// @Override
// public String toString() {
// StringBuffer s = new StringBuffer();
//
// StringUtil.appendLine(s, this.loginId);
// StringUtil.appendLine(s, this.password);
// StringUtil.appendLine(s, this.memberName);
// StringUtil.appendLine(s, this.sid);
// StringUtil.appendLine(s, this.contractId);
// StringUtil.appendLine(s, this.loginStatus);
// StringUtil.appendLine(s, this.invalidPasswordCount);
// StringUtil.appendLine(s, this.lastLogintDate);
// StringUtil.appendLine(s, this.lastChangePasswordDate);
//
// return s.toString();
// }
}
......@@ -59,15 +59,4 @@ public class MarkingLogic extends AbstractLogic {
public List<MarkingSettingDto> getMarkingSettingList() {
return markingSettingDao.getMarkingSettingList();
}
public boolean isMarkingExist() {
return contentMarkingDao.getAllMarkingList().size() > 0;
}
public String getMarkingFilePath(long contentId, String fileName) {
String path = String.format(ABVEnvironment.ContentMarkingDirectoryFormat, ABVEnvironment.getInstance().rootDirectory, contentId);
return path + "/" + fileName;
}
}
......@@ -69,23 +69,4 @@ public class MemoLogic extends AbstractLogic {
throw new RuntimeException(e);
}
}
public boolean isMemoExist() {
List<ContentDto> cDto = contentDao.getDownloadedContents();
boolean exist=false;
Logger.d("리스트 값 확인 ", "cDto 값 : %s", cDto);
for (int i=0; i<cDto.size(); i++)
{
List<ContentMemoDto> mDto = contentMemoDao.getMemoList(cDto.get(i).contentId);
if (mDto.size()==0) {
exist=false;
}else{
exist=true;
break;
}
}
return exist;
}
}
......@@ -57,7 +57,6 @@ public class MeetingManager extends Observable {
// コマンド定数
public static final String CMD_NOTICE = "notice";
public static final String CMD_MEETINGINFO = "meetinginfo";
public static final String CMD_GETMEETINGINFO = "getmeetinginfo";
public static final String CMD_OPEN = "open";
public static final String CMD_MOVEPAGE = "movePage";
public static final String CMD_TOBOOKSHELF = "toBookShelf";
......@@ -325,17 +324,6 @@ public class MeetingManager extends Observable {
}
/**
* WebSocketClientスレッドを待機(テスト用途)
*
* @throws InterruptedException
*/
public void joinWebSocketClientThread() throws InterruptedException {
if (webSocketClientThread != null) {
webSocketClientThread.join();
}
}
/**
* WebSocketを閉じる。
*
*/
......
......@@ -51,7 +51,6 @@ public class StringUtil {
public static final String Slash = "/";
public static final String BackSlash = "\\";
public static final String Hyphen = "-";
public static final String QuestionMark = "?";
private static final String RegexBriceL = "[";
private static final String RegexBriceR = "]";
......
......@@ -14,8 +14,4 @@ public class ABookHelper {
public static final ABVApplication getABVApplication(Context context) {
return (ABVApplication) context.getApplicationContext();
}
public static final ABVUIDataCache getABVUIDataCache(Context context) {
return getABVApplication(context).getABVUIDataCache();
}
}
......@@ -111,7 +111,6 @@ public abstract class ABVActivity extends Activity {
public static final String URL = "url";
public static final String MESSAGE = "message";
public static final String PASSWORD = "password";
public static final String IMPORT_ABK_PATH = "importAbkPath";
protected static final int FP = android.view.ViewGroup.LayoutParams.MATCH_PARENT;
protected static final int WC = android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
......@@ -719,10 +718,6 @@ public abstract class ABVActivity extends Activity {
return (getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL;
}
public boolean isLargeSize() {
return (getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE;
}
public boolean isOrientationPortrait() {
return getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;
}
......
......@@ -22,11 +22,6 @@ public class ABookAlertDialog extends AlertDialog {
init();
}
public ABookAlertDialog(Context context, int theme) {
super(context, theme);
init();
}
public ABookAlertDialog(Context context, boolean cancelable, OnCancelListener cancelListener) {
super(context, cancelable, cancelListener);
init();
......@@ -82,9 +77,4 @@ public class ABookAlertDialog extends AlertDialog {
setView(listView);
listView.setOnItemClickListener(l);
}
public void setItems(CharSequence[] items, final OnItemClickListener l) {
ListAdapter adapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, items);
setAdapter(adapter, l);
}
}
......@@ -113,7 +113,6 @@ public class Initializer {
// 既にMacAddress使用に同意している場合はMacAddressを使う
// 認証なしの場合はUUIDを使用する
int loginMode = context.getResources().getInteger(R.integer.login_mode);
// Wifiがオンになっていない場合アラートを表示できないので最初の設定はログイン前に行う。例外が発生しても無視。
try {
env.deviceId = DeviceInfo.getDeviceId(context, isDebugMode);
......
package jp.agentec.abook.abv.ui.common.view;
import android.annotation.SuppressLint;
import android.app.Activity;
import com.navdrawer.SimpleSideDrawer;
@SuppressLint("ViewConstructor")
public class ABookSideDrawer extends SimpleSideDrawer {
private int mOpenedSideMenuStatus = 0; // -1:left, 0:none, 1:right
public ABookSideDrawer(Activity act) {
super(act);
}
@Override
public void openLeftSide() {
super.openLeftSide();
mOpenedSideMenuStatus = -1;
}
@Override
public void openRightSide() {
super.openRightSide();
mOpenedSideMenuStatus = 1;
}
@Override
public void closeLeftSide() {
super.closeLeftSide();
mOpenedSideMenuStatus = 0;
}
@Override
public void closeRightSide() {
super.closeRightSide();
mOpenedSideMenuStatus = 0;
}
@Override
public void toggleLeftDrawer() {
super.toggleLeftDrawer();
if (mOpenedSideMenuStatus == 0) {
mOpenedSideMenuStatus = -1;
} else {
mOpenedSideMenuStatus = 0;
}
}
@Override
public void toggleRightDrawer() {
super.toggleRightDrawer();
if (mOpenedSideMenuStatus == 0) {
mOpenedSideMenuStatus = 1;
} else {
mOpenedSideMenuStatus = 0;
}
}
public void closeOpenedDrawer() {
switch (mOpenedSideMenuStatus) {
case 1 :
closeRightSide();
break;
case -1 :
closeLeftSide();
break;
default :
break;
}
}
}
......@@ -117,36 +117,11 @@ public class ABookSettingFragment extends PreferenceFragment {
super.onStart();
}
private boolean contains(String key) {
return pref.contains(key);
}
private void put(String key, boolean val) {
pref.edit().putBoolean(key, val).commit();
}
private void delete(String key) { // removePreferenceと区別するためdeleteとする
pref.edit().remove(key).commit();
}
private Preference findPref(String key) {
return getPreferenceManager().findPreference(key);
}
private void setSummary(String key, String val) {
PreferenceScreen prefScreen = (PreferenceScreen) findPreference(key);
prefScreen.setSummary(val);
}
private void remove(PreferenceGroup prefGroup, String key) {
Preference preference = findPreference(key);
prefGroup.removePreference(preference);
}
private void remove(PreferenceGroup prefGroup) {
getPreferenceScreen().removePreference(prefGroup);
}
private void setAccountSetting() {
PreferenceGroup accountSettings = (PreferenceGroup) findPreference(ACCOUNT_SET);
PreferenceScreen logout = (PreferenceScreen) findPreference(LOGOUT);
......
......@@ -125,8 +125,6 @@ import jp.agentec.adf.util.StringUtil;
public class GuideViewActivity extends ABVContentViewActivity {
private static final String TAG = "GuideViewActivity";
private ContentPageDao contentPageDao = AbstractDao.getDao(ContentPageDao.class);
/**
* mMainLayout > mPageScrollView > mContentWrapLayout
*/
......@@ -152,7 +150,6 @@ public class GuideViewActivity extends ABVContentViewActivity {
private ContentJSON mContentJSON; // コンテンツのJSONデータ
private PDFLinkJSON mPDFLinkJSON; // PDFリンクのJSONデータ
private PageInfoJSON mPageInfoJSON; // オーサリング画面の各ページサイズのJSONデータ
private Size mBaseFileSize;
private ContentDto mContentDto;
......@@ -164,8 +161,6 @@ public class GuideViewActivity extends ABVContentViewActivity {
private int mAllPageCount = 1; // 全ページ数
private Dialog mSearchDialog; // 検索ボックス
private GestureDetector mActivityGestureDetector; // フリックやスクロールジェスチャーを感知する。通常のScrollViewはページ遷移できないため。
private ScrollStatus mScrollStatus = ScrollStatus.NONE;
......@@ -193,16 +188,10 @@ public class GuideViewActivity extends ABVContentViewActivity {
private List<MarkingView> mMarkingViewList;
private boolean isAnotherViewOpenFlg = false;
private String mSearchWord;
private static final int HIGHLIGHT_COLOR = 0x80FF00FF; // 検索結果のテキストハイライト
private Bitmap baseBitmap = null; // ハイライト用元Bitmap
private int intervalAddOrRemovePage = 200;
private ToggleButton slide ;
private boolean contentLinkStatus = false; //콘텐츠 링크의 상태 Flg.
//앙케이트 모드
private EnqueteLayout enqueteLayout;
......@@ -223,11 +212,9 @@ public class GuideViewActivity extends ABVContentViewActivity {
//플레이 탭사운드 Flag 값
private boolean playTapSoundFlg = false;
private String preSoundFilePath;
//좌우 버튼 값 Flg
private boolean moveBtnFlg = false;
private boolean mEndFlg=false;
private boolean pageBgmFlg =false;
private boolean contentsBgmFlg = false;
......@@ -242,7 +229,6 @@ public class GuideViewActivity extends ABVContentViewActivity {
private View subscriberToolBar;
private Button mExitBtn;
private ImageButton mHistoryBtn;
private ImageButton mBtnMeetingRoomSetting;
private ImageButton mBtnRemoteStart;
private ConcurrentHashMap<Long, View> objectIdButtonMap = new ConcurrentHashMap<>();
private SharedPreferences pref;
......@@ -253,8 +239,6 @@ public class GuideViewActivity extends ABVContentViewActivity {
private boolean onCreateFinish = false; // カーソル連動に使用
private SparseArray<ZoomRelativeLayout> mShowPageLayout = new SparseArray<>();
private boolean testMode = false; // 単体TEST用
// private Matrix mZoomMatrix = null;
private boolean isEnqueteOpening = false;
......@@ -535,27 +519,6 @@ public class GuideViewActivity extends ABVContentViewActivity {
}
/**
* ベースファイルなし用に背景を作成する
* @param size:Bitmapのサイズ
*/
private Bitmap createBackgroundForNoFile(Size size) {
Bitmap bitmap = Bitmap.createBitmap(size.width, size.height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
Paint paint = new Paint();
if (mContentJSON.getBackgroundColor() != null && mContentJSON.getBackgroundColor().length() == 6) {
int r = Integer.parseInt(mContentJSON.getBackgroundColor().substring(0, 2), 16);
int g = Integer.parseInt(mContentJSON.getBackgroundColor().substring(2, 4), 16);
int b = Integer.parseInt(mContentJSON.getBackgroundColor().substring(4, 6), 16);
paint.setARGB(mContentJSON.getBackgroundAlpha(), r, g, b);
}
else {
paint.setColor(Color.WHITE);
}
canvas.drawRect(new RectF(0, 0, size.width, size.height), paint);
return bitmap;
}
/**
* 遠隔連動の状態に応じて、ツールバーや機能制限等の設定を行う
*
*/
......@@ -1271,7 +1234,6 @@ public class GuideViewActivity extends ABVContentViewActivity {
Logger.v(TAG, "[addPageView]start:page=%s", pageNumber);
long totalBitmapSize = calcImageSize(pageNumber) + mDisplaySize.width * mDisplaySize.height * 4 * 2; // イメージボタンとPDFの合計サイズ
boolean canDrawOrgSize = (totalBitmapSize < availableImageBytePerPage); // イメージをオリジナルサイズで描画してよいか
RelativeLayout pageLayout = new RelativeLayout(this) {
@Override
......@@ -1803,50 +1765,6 @@ public class GuideViewActivity extends ABVContentViewActivity {
}
}
}
/**
* Preview画面表示
* @param objectId
*/
private void showPreview(List<String> imagefile, Long objectId, int objectLogId) {
//20120803 イメージがない場合移動しない
if (isAnotherViewOpenFlg == false && !imagefile.isEmpty()) {
// isAnotherViewOpenFlg = true;
// Intent intent_ = new Intent(this, PreviewActivity.class);
// for (int i = 0; i < imagefile.size(); i++) {
// intent_.putExtra("FILEPATH" + (i + 1), mContentDir + "/" + imagefile.get(i));
// }
// intent_.putExtra("Position", 0);
// intent_.putExtra(ABookKeys.CONTENT_ID, getContentId());
// intent_.putExtra("pageNumber", mCurrentPageNumber);
// intent_.putExtra("objectId", objectId);
// intent_.putExtra("objectLogId", objectLogId);
// intent_.putExtra(INTERACTIVE_MODE, isInteractiveMode);
//
// startActivityForResult(intent_, PREVIEW);
//
// preViewFlg = true;
}
}
// /**
// * 表示する画像を指定してPreview画面表示
// * @param objectId
// */
// private void showPreview(List<String> imagefile, int potision, Long objectId) {
// //20120803 イメージがない場合移動しない
// if (isAnotherViewOpenFlg == false && !imagefile.isEmpty()) {
// isAnotherViewOpenFlg = true;
// Intent intent_ = new Intent(this, PreviewActivity.class);
// for (int i = 0; i < imagefile.size(); i++) {
// intent_.putExtra("FILEPATH" + (i + 1), imagefile.get(i));
// }
// intent_.putExtra("Position", potision);
// intent_.putExtra(KEY_CONTENT_ID, getContentId());
// intent_.putExtra("pageNumber", mCurrentPageNumber);
// intent_.putExtra("objectId", objectId);
// startActivityForResult(intent_, PREVIEW);
// }
// }
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
......@@ -1860,26 +1778,6 @@ public class GuideViewActivity extends ABVContentViewActivity {
}
}
private void sendEmail(String subject, String address) {
Logger.d(TAG, "sendEmail:" + address);
// Intentインスタンスを生成
Intent intent = new Intent();
// アクションを指定(ACTION_SENDTOではないところがミソ)
intent.setAction(Intent.ACTION_SEND);
// データタイプを指定
intent.setType("message/rfc822");
// 宛先を指定
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{address});
// 件名を指定
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
// 本文を指定
intent.putExtra(Intent.EXTRA_TEXT, getString(R.string.email_body));
// Intentを発行
startActivity(intent);
}
@Override
public void onStart() {
super.onStart();
......@@ -2308,12 +2206,6 @@ public class GuideViewActivity extends ABVContentViewActivity {
}
}
public void setMarkingReadOnly(boolean readOnly) {
if (isMarking) {
mMarkingLayout.setReadOnly(readOnly);
}
}
private void closeMarkingLayout() {
mMainLayout.removeView(mMarkingLayout);
isMarking = false;
......@@ -2559,12 +2451,6 @@ public class GuideViewActivity extends ABVContentViewActivity {
mScrollStatus = ScrollStatus.NONE;
}
//20120803
//スクロールが移動してる状態はFALSE
private boolean getTouchScrollPosition() {
return mCurrentPageNumber*mDisplaySize.width == mPageScrollView.getScrollX();
}
/**
* PDFサイズをオーサリング上のサイズに変換するクラス
* @author jang
......
package jp.agentec.abook.abv.ui.home.adapter;
import java.util.ArrayList;
import java.util.List;
import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.launcher.android.R;
import android.os.AsyncTask;
import android.view.View;
import android.widget.BaseAdapter;
import android.widget.ImageView;
public abstract class AbstractContentListAdapter extends BaseAdapter {
protected AbstractContentListAdapterListener listener;
protected List<ContentDto> listItem = new ArrayList<>(); // NullPointException防止
public boolean isEditMode;
public interface AbstractContentListAdapterListener {
boolean onContentDownload(long contentId);
void onContentDownloadPause(long contentId);
void onContentDownloadResume(ContentDto contentDto);
void onOpenContentView(long contentId);
void onOpenContentSubmenu(ContentDto contentDto);
void onContentChecked();
}
@Override
public int getCount() {
return listItem.size();
}
@Override
public ContentDto getItem(int position) {
return listItem.get(position);
}
@Override
public long getItemId(int position) {
return listItem.get(position).contentId;
}
public void setItem(List<ContentDto> listItem) {
this.listItem= listItem;
notifyDataSetChanged();
}
public void setAdapterListener(AbstractContentListAdapterListener listener) {
this.listener = listener;
}
/**
* 該当コンテンツのダウンロード関連のビューを更新します
*
* @param contentDto
*/
public abstract void updateDownloadView(ContentDto contentDto);
protected class OnDownloadButtonClickListener implements View.OnClickListener{
private ContentDto contentDto;
public OnDownloadButtonClickListener(ContentDto contentDto) { // FIXME: 他の処理との整合性
this.contentDto = contentDto;
}
@Override
public void onClick(final View v) {
contentDto.downloadingFlg = true;
updateDownloadView(contentDto);
// ダウンロード登録に時間がかかるので非同期処理で実行
AsyncTask<Params, Void, Result> task = new AsyncTask<Params, Void, Result>() {
@Override
protected Result doInBackground(Params... params) {
Result result = new Result();
result.result = listener.onContentDownload(params[0].contentId);
return result;
}
@Override
protected void onPostExecute(Result result) {
if (!result.result) {
contentDto.downloadingFlg = false;
updateDownloadView(contentDto);
}
}
};
Params params = new Params();
params.contentId = contentDto.contentId;
task.execute(params);
}
}
protected class OnDownloadPauseButtonClickListener implements View.OnClickListener{
private ContentDto contentDto;
public OnDownloadPauseButtonClickListener(ContentDto contentDto) {
this.contentDto = contentDto;
}
@Override
public void onClick(View v) {
AsyncTask<Params, Void, Void> task = new AsyncTask<Params, Void, Void>() {
@Override
protected Void doInBackground(Params... params) {
listener.onContentDownloadPause(params[0].contentId);
return null;
}
};
Params params = new Params();
params.contentId = contentDto.contentId;
task.execute(params);
}
}
protected class OnDownloadResumeButtonClickListener implements View.OnClickListener{
private ContentDto contentDto;
public OnDownloadResumeButtonClickListener(ContentDto contentDto) {
this.contentDto = contentDto;
}
@Override
public void onClick(View v) {
// ダウンロード登録に時間がかかるので非同期処理で実行
AsyncTask<Params, Void, Void> task = new AsyncTask<Params, Void, Void>() {
@Override
protected Void doInBackground(Params... params) {
listener.onContentDownloadResume(contentDto);
return null;
}
};
Params params = new Params();
params.contentId = contentDto.contentId;
task.execute(params);
}
}
protected void setRibbonBackground(ImageView ribbon, ContentDto contentDto) {
if (contentDto.downloadedFlg) {
if (contentDto.updatedFlg) {
ribbon.setImageResource(R.drawable.icon_updated);
ribbon.setVisibility(View.VISIBLE);
} else {
if (contentDto.readingCount > 0) {
ribbon.setVisibility(View.INVISIBLE);
} else {
ribbon.setImageResource(R.drawable.icon_unread);
ribbon.setVisibility(View.VISIBLE);
}
}
} else {
if (contentDto.newFlg) {
ribbon.setImageResource(R.drawable.icon_new);
ribbon.setVisibility(View.VISIBLE);
} else {
ribbon.setVisibility(View.INVISIBLE);
}
}
}
}
class Params {
long contentId;
}
class Result {
boolean result;
}
......@@ -64,17 +64,16 @@ public class ABookCheckWebViewHelper extends ABookHelper {
}
public void doABookCheckParam(ABVContentViewActivity context, String cmd, String taskKey, int reportUpdateType, Map<String, String> param, long projectId, String contentPath, long contentId, boolean inspectReportFlg, Callback finishCallback) throws IOException {
boolean result = true;
int taskReportSendId = 0;
mFinishCallback = finishCallback;
switch (cmd) {
case ABookKeys.CMD_INSERT_TASK_DIRECTIONS:
insertOrUpdateTaskDirections(taskKey, projectId, contentId, param, contentPath, true, true);
insertOrUpdateTaskDirections(taskKey, projectId, contentId, param, contentPath, true);
copyTaskAttachedMovie(projectId, contentId, taskKey);
sendTaskDirectionsData(context, projectId, taskKey);
break;
case ABookKeys.CMD_UPDATE_TASK_DIRECTIONS:
insertOrUpdateTaskDirections(taskKey, projectId, contentId, param, contentPath, true, false);
insertOrUpdateTaskDirections(taskKey, projectId, contentId, param, contentPath, false);
copyTaskAttachedMovie(projectId, contentId, taskKey);
sendTaskDirectionsData(context, projectId, taskKey);
......@@ -90,11 +89,11 @@ public class ABookCheckWebViewHelper extends ABookHelper {
mProjectLogic.createHopSpotJson(projectId, contentPath);
break;
case ABookKeys.CMD_INSERT_TASK_REPORT:
insertOrUpdateTaskReport(taskKey, reportUpdateType, projectId, contentId, param, contentPath, true, true, inspectReportFlg);
insertOrUpdateTaskReport(taskKey, reportUpdateType, projectId, contentId, param, contentPath, true, inspectReportFlg);
sendTaskReportData(context, projectId, taskKey, reportUpdateType);
break;
case ABookKeys.CMD_UPDATE_TASK_REPORT:
insertOrUpdateTaskReport(taskKey, reportUpdateType, projectId, contentId, param, contentPath, true, false, inspectReportFlg);
insertOrUpdateTaskReport(taskKey, reportUpdateType, projectId, contentId, param, contentPath, false, inspectReportFlg);
sendTaskReportData(context, projectId, taskKey, reportUpdateType);
break;
case ABookKeys.CMD_DELETE_TASK_REPORT:
......@@ -244,19 +243,6 @@ public class ABookCheckWebViewHelper extends ABookHelper {
}
});
}
/**
* 作業データ受信
* @param projectId
* @return
* @throws NetworkDisconnectedException
* @throws ABVException
*/
public Date receptionTaskData(long projectId) throws NetworkDisconnectedException, ABVException {
GetProjectDataParameters param = new GetProjectDataParameters(ABVDataCache.getInstance().getMemberInfo().sid, projectId);
ProjectDataJSON json = AcmsClient.getInstance(ABVDataCache.getInstance().getUrlPath(), ABVEnvironment.getInstance().networkAdapter).getProjectData(param);
return json.lastEditDate;
}
public void doABookCheckParamPdf(long projectId, ProjectTaskDto projectTaskDto, String contentPath) {
try {
......@@ -336,11 +322,10 @@ public class ABookCheckWebViewHelper extends ABookHelper {
* @param contentId
* @param param
* @param contentPath
* @param dataSendFlg
* @param insertFlg
* @throws IOException
*/
private void insertOrUpdateTaskDirections(String taskKey, long projectId, long contentId, Map<String, String> param, String contentPath, boolean dataSendFlg, boolean insertFlg) throws IOException {
private void insertOrUpdateTaskDirections(String taskKey, long projectId, long contentId, Map<String, String> param, String contentPath, boolean insertFlg) throws IOException {
boolean attachedChangeFlag = param.get(ABookKeys.ATTACHED_CHANGE_FLAG).equals("1") ? true : false;
String taskDirections = param.get(ABookKeys.TASK_DIRECTIONS);
JSONObject taskDirectionsJson = new JSONObject(taskDirections);
......@@ -354,12 +339,11 @@ public class ABookCheckWebViewHelper extends ABookHelper {
}
}
private void insertOrUpdateTaskReport(String taskKey, int reportUpdateType, long projectId, long contentId, Map<String, String> param, String contentPath, boolean dataSendFlg, boolean insertFlg, boolean inspectReportFlg) throws IOException {
private void insertOrUpdateTaskReport(String taskKey, int reportUpdateType, long projectId, long contentId, Map<String, String> param, String contentPath, boolean insertFlg, boolean inspectReportFlg) throws IOException {
int taskReportSendId = 0;
boolean attachedChangeFlag = param.get(ABookKeys.ATTACHED_CHANGE_FLAG).equals("1") ? true : false;
String taskReport = param.get(ABookKeys.TASK_REPORT);
JSONObject taskReportJson = new JSONObject(taskReport);
String taskHotSpotInfo = param.get(ABookKeys.HOT_SPOT);
int taskReportId = 0;
String reportStartDate = "";
......@@ -418,7 +402,6 @@ public class ABookCheckWebViewHelper extends ABookHelper {
// xwalkで動画ファイルにアクセスするため、../files/..の以下のパスのディレクトりを../cache/..以下のパスに変更
public void allCopyTaskAttachedMovieFileToCache(long projectId, long contentId, ProjectDto projectDto) {
try {
String projectTaskDirPath = ABVEnvironment.getInstance().getProjectDirFile(projectId);
List<TaskDto> taskDtoList = mProjectLogic.getProjectTask(projectId);
for (TaskDto taskDto : taskDtoList) {
if (projectDto.projectReportType == Constant.ProjectReportType.INSPECT_REPORT) {
......@@ -581,7 +564,6 @@ public class ABookCheckWebViewHelper extends ABookHelper {
}
public String contentSchemeUriToFilePath(Cursor cursor) {
int rotationAngle = 0;
String photoFilePath = null;
if (cursor != null) {
if (cursor.moveToFirst()) {
......
......@@ -19,14 +19,4 @@ public class ABookHelper {
}
return true;
}
protected void startChrome(Context context, String url) {
Uri uri = Uri.parse(url);
Intent intent = new Intent();
intent.setPackage("com.android.chrome");
intent.setAction(Intent.ACTION_VIEW);
intent.setData(uri);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
}
......@@ -165,11 +165,4 @@ public class ABookPermissionHelper {
return true;
}
public boolean checkOverlaysPermission() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
return false;
} else {
return !Settings.canDrawOverlays(mActivity);
}
}
}
......@@ -447,15 +447,6 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
}
private void removeNewFlag() {
// Newフラグ更新
ContentDto contentDto = AbstractDao.getDao(ContentDao.class).getContent(contentId);
if (contentDto.newFlg) {
contentDto.newFlg = false;
contentDao.updateContent(contentDto, false);
}
}
private class JsInf {
@JavascriptInterface
public void existSetLocation(String ret) {
......@@ -679,28 +670,6 @@ public class HTMLWebViewActivity extends ParentWebViewActivity {
});
}
private void callExistsSendLog() { // setLocation functionがjavascriptに定義されているかどうかを調べる(結果はexistSendLogメソッドにコールバック)
runOnUiThread(new Runnable() {
@Override
public void run() {
if (webView != null) {
webView.loadUrl("javascript:android.existSendLog(typeof sendLog == 'function')");
}
}
});
handler.postDelayed(new Runnable() { // 10秒後に終了していない場合に終了
@Override
public void run() {
//noinspection VariableNotUsedInsideIf
if (webView != null) {
Logger.w(TAG, "Finish forcibly");
finishActivity();
}
}
}, 10000);
}
@Override
protected void webViewLoadUrl(String url){
if (webView != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment