Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjoongcho committed Aug 22, 2020
1 parent 3de80d9 commit f460300
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package me.blog.korn123.easydiary.fragments

import android.app.Activity
import android.content.Context
import android.content.DialogInterface
import android.content.Intent
import android.os.Bundle
Expand Down Expand Up @@ -41,15 +42,17 @@ class SettingsGMSBackupFragment() : androidx.fragment.app.Fragment() {
***************************************************************************************************/
private lateinit var progressContainer: ConstraintLayout
private lateinit var mRootView: ViewGroup
private lateinit var mContext: Context
private var mTaskFlag = 0
private val mActivity: Activity
get() = activity!!


/***************************************************************************************************
* override functions
*
***************************************************************************************************/
override fun onAttach(context: Context) {
super.onAttach(context)
this.mContext = context
}

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
mRootView = inflater.inflate(R.layout.layout_settings_backup_gms, container, false) as ViewGroup
return mRootView
Expand Down Expand Up @@ -133,7 +136,7 @@ class SettingsGMSBackupFragment() : androidx.fragment.app.Fragment() {
progressContainer.visibility = View.VISIBLE
val realmPath = EasyDiaryDbHelper.getRealmPath()
initGoogleSignAccount(this) { account ->
DriveServiceHelper(mActivity, account).run {
DriveServiceHelper(mContext, account).run {
initDriveWorkingDirectory(DriveServiceHelper.AAF_EASY_DIARY_REALM_FOLDER_NAME) {
createFile(
it!!, realmPath,
Expand Down Expand Up @@ -162,7 +165,7 @@ class SettingsGMSBackupFragment() : androidx.fragment.app.Fragment() {

private fun openRealmFilePickerDialog() {
initGoogleSignAccount(this) { account ->
val driveServiceHelper = DriveServiceHelper(mActivity, account)
val driveServiceHelper = DriveServiceHelper(mContext, account)

// driveServiceHelper.queryFiles("mimeType contains 'text/aaf_v' and name contains '$DIARY_DB_NAME'", 1000)

Expand Down Expand Up @@ -231,7 +234,7 @@ class SettingsGMSBackupFragment() : androidx.fragment.app.Fragment() {
mActivity.setScreenOrientationSensor(false)
progressContainer.visibility = View.VISIBLE
initGoogleSignAccount(this) { account ->
DriveServiceHelper(mActivity, account).run {
DriveServiceHelper(mContext, account).run {
initDriveWorkingDirectory(DriveServiceHelper.AAF_EASY_DIARY_PHOTO_FOLDER_NAME) { photoFolderId ->
progressContainer.visibility = View.GONE
mActivity.run {
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/assets/RELEASE_en
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

---------------------------------------------------

# Changes in 1.4.142 (date: 2020.08.22)
* Fixed an issue where some devices were abnormally terminated in the setting screen

# Changes in 1.4.141 (date: 2020.08.03)
* User Experience (UX) Optimization
* French translation updates
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/assets/RELEASE_ja
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

---------------------------------------------------

# Changes in 1.4.142 (date: 2020.08.22)
* 一部のデバイスが設定画面で異常終了する問題を修正しました

# Changes in 1.4.141 (date: 2020.08.03)
* ユーザーエクスペリエンス(UX)の最適化
* フランス語翻訳の更新
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/assets/RELEASE_ko
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

---------------------------------------------------

# Changes in 1.4.142 (date: 2020.08.22)
* 일부기기가 설정화면에서 비정상 종료되는 이슈 해결

# Changes in 1.4.141 (date: 2020.08.03)
* 사용자경험(UX) 최적화
* 프랑스어 번역 업데이트
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ open class EasyDiaryActivity : BaseSimpleActivity() {

fun checkWhatsNewDialog(applyFilter: Boolean = true) {
arrayListOf<Release>().apply {
add(Release(208, R.string.release_208))
add(Release(207, R.string.release_207))
add(Release(206, R.string.release_206))
add(Release(205, R.string.release_205))
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@
User Experience (UX) Optimization\n
French translation updates
</string>
<string name="release_208">
v1.4.142 / 2020.08.22\n
Fixed an issue where some devices were abnormally terminated in the setting screen
</string>

<!-- ////////////////////////////////////////////////////////////////////////////////////////////// -->
<!-- Resources added since version 1.4.47 here. -->
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values-en/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@
User Experience (UX) Optimization\n
French translation updates
</string>
<string name="release_208">
v1.4.142 / 2020.08.22\n
Fixed an issue where some devices were abnormally terminated in the setting screen
</string>

<!-- ////////////////////////////////////////////////////////////////////////////////////////////// -->
<!-- Resources added since version 1.4.47 here. -->
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@
User Experience (UX) Optimization\n
French translation updates
</string>
<string name="release_208">
v1.4.142 / 2020.08.22\n
Fixed an issue where some devices were abnormally terminated in the setting screen
</string>

<!-- ////////////////////////////////////////////////////////////////////////////////////////////// -->
<!-- Resources added since version 1.4.47 here. -->
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -442,13 +442,17 @@
</string>
<string name="release_206">
v1.4.140 / 2020.07.20\n
Fixed an error that the scheduler did not work in the application termination state
アプリケーションが最近使用アプリ一覧から削除された場合、スケジューラが動作しなかったエラーを修正する
</string>
<string name="release_207">
v1.4.141 / 2020.08.03\n
ユーザーエクスペリエンス(UX)の最適化\n
フランス語翻訳の更新
</string>
<string name="release_208">
v1.4.142 / 2020.08.22\n
一部のデバイスが設定画面で異常終了する問題を修正しました
</string>

<!-- ////////////////////////////////////////////////////////////////////////////////////////////// -->
<!-- Resources added since version 1.4.47 here. -->
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/res/values-ko/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -442,13 +442,17 @@
</string>
<string name="release_206">
v1.4.140 / 2020.07.20\n
Fixed an error that the scheduler did not work in the application termination state
애플리케이션이 최근 사용 앱 목록에서 제거되는 경우 스케줄러가 동작하지 않던 오류를 수정함
</string>
<string name="release_207">
v1.4.141 / 2020.08.03\n
사용자경험(UX) 최적화\n
프랑스어 번역 업데이트
</string>
<string name="release_208">
v1.4.142 / 2020.08.22\n
일부기기가 설정화면에서 비정상 종료되는 이슈 해결
</string>

<!-- ////////////////////////////////////////////////////////////////////////////////////////////// -->
<!-- Resources added since version 1.4.47 here. -->
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@
User Experience (UX) Optimization\n
French translation updates
</string>
<string name="release_208">
v1.4.142 / 2020.08.22\n
Fixed an issue where some devices were abnormally terminated in the setting screen
</string>

<!-- ////////////////////////////////////////////////////////////////////////////////////////////// -->
<!-- Resources added since version 1.4.47 here. -->
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@
User Experience (UX) Optimization\n
French translation updates
</string>
<string name="release_208">
v1.4.142 / 2020.08.22\n
Fixed an issue where some devices were abnormally terminated in the setting screen
</string>

<!-- ////////////////////////////////////////////////////////////////////////////////////////////// -->
<!-- Resources added since version 1.4.47 here. -->
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@
User Experience (UX) Optimization\n
French translation updates
</string>
<string name="release_208">
v1.4.142 / 2020.08.22\n
Fixed an issue where some devices were abnormally terminated in the setting screen
</string>

<!-- ////////////////////////////////////////////////////////////////////////////////////////////// -->
<!-- Resources added since version 1.4.47 here. -->
Expand Down

0 comments on commit f460300

Please sign in to comment.