Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abook_check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_android
abook_check
Commits
9ae2850b
Commit
9ae2850b
authored
May 29, 2023
by
Kazuyuki Hida
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不要なファイルを削除
parent
0ec230c3
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
0 additions
and
332 deletions
+0
-332
ABVJE_Launcher_Android/AndroidManifest.xml
+0
-4
ABVJE_UI_Android/res/layout/ac_agreement_to_terms.xml
+0
-84
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVNoAuthenticatedActivity.java
+0
-1
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/helper/AgreementToTermsHelper.java
+0
-4
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/AgreementToTermsActivity.java
+0
-235
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/AgreementToTermsActivityDialog.java
+0
-4
No files found.
ABVJE_Launcher_Android/AndroidManifest.xml
View file @
9ae2850b
...
@@ -256,8 +256,5 @@
...
@@ -256,8 +256,5 @@
android:theme=
"@style/AppTheme"
android:theme=
"@style/AppTheme"
android:configChanges=
"keyboardHidden|orientation|screenSize"
>
android:configChanges=
"keyboardHidden|orientation|screenSize"
>
</activity>
</activity>
<activity
android:name=
"jp.agentec.abook.abv.ui.home.activity.AgreementToTermsActivity"
android:theme=
"@android:style/Theme.NoTitleBar.Fullscreen"
/>
<activity
android:name=
"jp.agentec.abook.abv.ui.home.activity.AgreementToTermsActivityDialog"
android:theme=
"@style/Theme.MyTheme.ModalDialog"
/>
</application>
</application>
</manifest>
</manifest>
\ No newline at end of file
ABVJE_UI_Android/res/layout/ac_agreement_to_terms.xml
deleted
100644 → 0
View file @
0ec230c3
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/basic_white1"
>
<!-- ヘッダ -->
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/list_first_color"
>
<TextView
android:id=
"@+id/disagreeButton"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentStart=
"true"
android:layout_centerVertical=
"true"
android:text=
"@string/disagree"
android:textColor=
"@color/dialog_text_color"
android:padding=
"16dp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
android:text=
"@string/terms_of_service"
android:textColor=
"@color/dialog_text_color"
android:padding=
"16dp"
/>
<TextView
android:id=
"@+id/agreeButton"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentEnd=
"true"
android:layout_centerVertical=
"true"
android:text=
"@string/agree"
android:textColor=
"@color/dialog_text_color"
android:padding=
"16dp"
tools:ignore=
"RelativeOverlap"
/>
</RelativeLayout>
<!-- 規約 -->
<ScrollView
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
>
<LinearLayout
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:padding=
"16dp"
>
<TextView
android:id=
"@+id/textVersion"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"end"
android:textColor=
"@color/dialog_text_color"
android:textSize=
"16sp"
android:lineSpacingMultiplier=
"1.2"
/>
<TextView
android:id=
"@+id/textTerms"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:textColor=
"@color/dialog_text_color"
android:textSize=
"18sp"
android:lineSpacingMultiplier=
"1.2"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
\ No newline at end of file
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVNoAuthenticatedActivity.java
View file @
9ae2850b
...
@@ -53,7 +53,6 @@ import jp.agentec.abook.abv.ui.common.helper.AgreementToTermsHelper;
...
@@ -53,7 +53,6 @@ import jp.agentec.abook.abv.ui.common.helper.AgreementToTermsHelper;
import
jp.agentec.abook.abv.ui.common.helper.LogoutHelper
;
import
jp.agentec.abook.abv.ui.common.helper.LogoutHelper
;
import
jp.agentec.abook.abv.ui.common.util.ABVToastUtil
;
import
jp.agentec.abook.abv.ui.common.util.ABVToastUtil
;
import
jp.agentec.abook.abv.ui.common.util.AlertDialogUtil
;
import
jp.agentec.abook.abv.ui.common.util.AlertDialogUtil
;
import
jp.agentec.abook.abv.ui.home.activity.AgreementToTermsActivity
;
import
jp.agentec.abook.abv.ui.home.activity.LoginActivity
;
import
jp.agentec.abook.abv.ui.home.activity.LoginActivity
;
import
jp.agentec.abook.abv.ui.home.activity.OperationListActivity
;
import
jp.agentec.abook.abv.ui.home.activity.OperationListActivity
;
import
jp.agentec.abook.abv.ui.home.helper.ABookPermissionHelper
;
import
jp.agentec.abook.abv.ui.home.helper.ABookPermissionHelper
;
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/helper/AgreementToTermsHelper.java
View file @
9ae2850b
...
@@ -7,11 +7,9 @@ import android.view.Display;
...
@@ -7,11 +7,9 @@ import android.view.Display;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
import
android.view.WindowManager
;
import
android.view.WindowManager
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
jp.agentec.abook.abv.bl.acms.client.json.AgreementToTermsJSON
;
import
jp.agentec.abook.abv.bl.acms.client.json.AgreementToTermsJSON
;
import
jp.agentec.abook.abv.bl.common.CommonExecutor
;
import
jp.agentec.abook.abv.bl.common.CommonExecutor
;
...
@@ -24,9 +22,7 @@ import jp.agentec.abook.abv.bl.logic.AgreementToTermsLogic;
...
@@ -24,9 +22,7 @@ import jp.agentec.abook.abv.bl.logic.AgreementToTermsLogic;
import
jp.agentec.abook.abv.cl.util.PreferenceUtil
;
import
jp.agentec.abook.abv.cl.util.PreferenceUtil
;
import
jp.agentec.abook.abv.launcher.android.R
;
import
jp.agentec.abook.abv.launcher.android.R
;
import
jp.agentec.abook.abv.ui.common.activity.ABVActivity
;
import
jp.agentec.abook.abv.ui.common.activity.ABVActivity
;
import
jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog
;
import
jp.agentec.abook.abv.ui.common.util.AlertDialogUtil
;
import
jp.agentec.abook.abv.ui.common.util.AlertDialogUtil
;
import
jp.agentec.abook.abv.ui.home.activity.AgreementToTermsActivity
;
/**
/**
* 規約同意ダイアログを表示するヘルパー
* 規約同意ダイアログを表示するヘルパー
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/AgreementToTermsActivity.java
deleted
100644 → 0
View file @
0ec230c3
package
jp
.
agentec
.
abook
.
abv
.
ui
.
home
.
activity
;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.KeyEvent
;
import
android.view.View
;
import
android.widget.TextView
;
import
jp.agentec.abook.abv.bl.acms.client.json.AgreementToTermsJSON
;
import
jp.agentec.abook.abv.bl.common.CommonExecutor
;
import
jp.agentec.abook.abv.bl.common.constant.ABookKeys
;
import
jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException
;
import
jp.agentec.abook.abv.bl.common.log.Logger
;
import
jp.agentec.abook.abv.bl.data.ABVDataCache
;
import
jp.agentec.abook.abv.bl.logic.AbstractLogic
;
import
jp.agentec.abook.abv.bl.logic.AgreementToTermsLogic
;
import
jp.agentec.abook.abv.cl.util.PreferenceUtil
;
import
jp.agentec.abook.abv.launcher.android.R
;
import
jp.agentec.abook.abv.ui.common.activity.ABVActivity
;
import
jp.agentec.abook.abv.ui.common.activity.ABVUIActivity
;
import
jp.agentec.abook.abv.ui.common.util.AlertDialogUtil
;
/**
* 規約同意画面
* AgreementToTermsActivity.confirmAgreement()メソッドを実行すると、
* 規約同意画面を表示する必要があるかを判別して、必要な場合のみ表示する。
* 規約に同意したか同意しなかったかは、onActivityResult()でresultCodeがRESULT_OKなら同意、
* RESULT_CANCELEDだったら同意しないと判別する
*/
public
class
AgreementToTermsActivity
extends
ABVUIActivity
{
private
static
final
String
TAG
=
"AgreementToTermsActivity"
;
private
String
currentVersion
=
""
;
/**
* 規約同意画面を表示しなかった(あるいはできなかった)場合の処理を指定するリスナー
*/
public
interface
PreAgreementListener
{
// 規約同意オプションがNoだった
void
onDisabled
();
// 規約内容やバージョンが空だった
void
onEmpty
();
// すでに同意済みだった
void
onAgreed
();
// 規約情報の取得に失敗した
void
onFailed
(
Exception
e
);
}
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
ac_agreement_to_terms
);
TextView
versionText
=
findViewById
(
R
.
id
.
textVersion
);
TextView
termsText
=
findViewById
(
R
.
id
.
textTerms
);
Intent
intent
=
getIntent
();
if
(
intent
!=
null
)
{
currentVersion
=
intent
.
getStringExtra
(
ABookKeys
.
AGREEMENT_TO_TERMS_VERSION
);
versionText
.
setText
(
currentVersion
);
termsText
.
setText
(
intent
.
getStringExtra
(
ABookKeys
.
AGREEMENT_TO_TERMS
));
}
setResult
(
RESULT_CANCELED
);
findViewById
(
R
.
id
.
disagreeButton
).
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
disagree
();
}
});
findViewById
(
R
.
id
.
agreeButton
).
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
agree
();
}
});
}
@Override
public
void
onBackPressed
()
{
disagree
();
}
@Override
public
boolean
onKeyUp
(
int
keyCode
,
KeyEvent
event
)
{
if
(
keyCode
==
KeyEvent
.
KEYCODE_BACK
)
{
disagree
();
return
true
;
}
else
{
return
super
.
onKeyUp
(
keyCode
,
event
);
}
}
/**
* 同意するをタップしたときの処理
*/
private
void
agree
()
{
showProgressPopup
();
CommonExecutor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
// 同意したことをCMSに送信
AgreementToTermsLogic
logic
=
AbstractLogic
.
getLogic
(
AgreementToTermsLogic
.
class
);
logic
.
agreeTerms
(
currentVersion
);
// 同意したバージョンを保存して閉じる
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
setLatestVersion
(
AgreementToTermsActivity
.
this
,
currentVersion
);
setResult
(
RESULT_OK
);
finish
();
}
});
}
catch
(
final
Exception
e
)
{
Logger
.
e
(
TAG
,
e
);
// 失敗したらアラート表示
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
int
messageId
;
if
(
e
instanceof
NetworkDisconnectedException
)
{
messageId
=
R
.
string
.
msg_network_offline
;
}
else
{
messageId
=
R
.
string
.
failed_to_send_agreement
;
}
AlertDialogUtil
.
showAlertDialog
(
AgreementToTermsActivity
.
this
,
R
.
string
.
app_name
,
messageId
);
}
});
}
finally
{
closeProgressPopup
();
}
}
});
}
/**
* 同意しないをタップしたときの処理
*/
private
void
disagree
()
{
// 確認ダイアログ
AlertDialogUtil
.
showAlertDialog
(
this
,
R
.
string
.
app_name
,
R
.
string
.
logout_by_disagree
,
false
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
// ログアウトしてよし
setResult
(
RESULT_CANCELED
);
finish
();
}
}
);
}
/**
* 同意規約情報を読み込んで、バージョンが異なっていたら、Activityを表示
* バージョンが同じだったら何もしない
* 呼び出し側は、onActivityResultで、resultCode が RESULT_OK なら同意した、
* RESULT_CANCELEDなら同意しなかったと判断する
*
* @param context 呼び出し元アクティビティ
* @param requestCode startActivityForResultで使用するリクエスト・コード
* @param isNormalSize 端末サイズ指定(スマホならtrue)
* @param listener 規約同意画面を表示する前に結果が出た時の動作を指定するリスナー
*/
public
static
void
confirmAgreement
(
final
ABVActivity
context
,
final
int
requestCode
,
final
boolean
isNormalSize
,
final
PreAgreementListener
listener
)
{
if
(!
ABVDataCache
.
getInstance
().
serviceOption
.
isUsableAgreementToTerms
())
{
// 規約同意オプションが無効な場合、何もしない
listener
.
onDisabled
();
return
;
}
context
.
showProgressPopup
();
CommonExecutor
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
AgreementToTermsLogic
logic
=
AbstractLogic
.
getLogic
(
AgreementToTermsLogic
.
class
);
AgreementToTermsJSON
json
=
logic
.
getTerms
();
if
(
json
.
getTerms
().
isEmpty
()
||
json
.
getTermsVersion
().
isEmpty
())
{
// 規約内容やバージョンが空の場合は何もしない
listener
.
onEmpty
();
return
;
}
if
(
getLatestVersion
(
context
).
equals
(
json
.
getTermsVersion
()))
{
// 規約のバージョンが、すでに同意しているものと同じときは何もしない
listener
.
onAgreed
();
return
;
}
// ダイアログ表示
Intent
intent
=
new
Intent
(
context
,
isNormalSize
?
AgreementToTermsActivity
.
class
:
AgreementToTermsActivityDialog
.
class
);
intent
.
putExtra
(
ABookKeys
.
AGREEMENT_TO_TERMS_VERSION
,
json
.
getTermsVersion
());
intent
.
putExtra
(
ABookKeys
.
AGREEMENT_TO_TERMS
,
json
.
getTerms
());
context
.
startActivityForResult
(
intent
,
requestCode
);
}
catch
(
final
Exception
e
)
{
Logger
.
e
(
TAG
,
e
);
context
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
listener
.
onFailed
(
e
);
}
});
}
finally
{
context
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
context
.
closeProgressPopup
();
}
});
}
}
});
}
/**
* 直近の同意した規約のバージョンを返すメソッド
*
* @param context SharedPreferenceにアクセスするためのコンテキスト
* @return バージョン文字列
*/
private
static
String
getLatestVersion
(
Context
context
)
{
return
PreferenceUtil
.
getUserPref
(
context
,
ABookKeys
.
AGREEMENT_TO_TERMS_VERSION
,
""
);
}
/**
* 直近の同意した規約のバージョンを保存するメソッド
*
* @param context SharedPreferenceにアクセスするためのコンテキスト
* @param version バージョン文字列
*/
private
static
void
setLatestVersion
(
Context
context
,
String
version
)
{
PreferenceUtil
.
putUserPref
(
context
,
ABookKeys
.
AGREEMENT_TO_TERMS_VERSION
,
version
);
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/home/activity/AgreementToTermsActivityDialog.java
deleted
100644 → 0
View file @
0ec230c3
package
jp
.
agentec
.
abook
.
abv
.
ui
.
home
.
activity
;
public
class
AgreementToTermsActivityDialog
extends
AgreementToTermsActivity
{
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment