Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
tmo1 committed Aug 14, 2023
2 parents 6416bd3 + 2672712 commit 3c2084d
Showing 1 changed file with 22 additions and 36 deletions.
58 changes: 22 additions & 36 deletions app/src/main/java/com/github/tmo1/sms_ie/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ import android.text.format.DateUtils.formatElapsedTime
import android.view.Menu
import android.view.MenuInflater
import android.view.MenuItem
import android.view.View
import android.widget.Button
import android.widget.ProgressBar
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
Expand Down Expand Up @@ -183,11 +183,9 @@ class MainActivity : AppCompatActivity(), ConfirmWipeFragment.NoticeDialogListen
}
startActivityForResult(intent, EXPORT_MESSAGES)
} else {
Toast.makeText(
this,
getString(R.string.sms_permissions_required),
Toast.LENGTH_LONG
).show()
val statusReportText: TextView = findViewById(R.id.status_report)
statusReportText.text = getString(R.string.sms_permissions_required)
statusReportText.visibility = View.VISIBLE
}
}

Expand All @@ -200,11 +198,9 @@ class MainActivity : AppCompatActivity(), ConfirmWipeFragment.NoticeDialogListen
}
startActivityForResult(intent, IMPORT_MESSAGES)
} else {
Toast.makeText(
this@MainActivity,
getString(R.string.default_sms_app_requirement),
Toast.LENGTH_LONG
).show()
val statusReportText: TextView = findViewById(R.id.status_report)
statusReportText.text = getString(R.string.default_sms_app_requirement)
statusReportText.visibility = View.VISIBLE
}
}

Expand All @@ -219,11 +215,9 @@ class MainActivity : AppCompatActivity(), ConfirmWipeFragment.NoticeDialogListen
}
startActivityForResult(intent, EXPORT_CALL_LOG)
} else {
Toast.makeText(
this,
getString(R.string.call_logs_permissions_required),
Toast.LENGTH_LONG
).show()
val statusReportText: TextView = findViewById(R.id.status_report)
statusReportText.text = getString(R.string.call_logs_permissions_required)
statusReportText.visibility = View.VISIBLE
}
}

Expand All @@ -236,11 +230,9 @@ class MainActivity : AppCompatActivity(), ConfirmWipeFragment.NoticeDialogListen
}
startActivityForResult(intent, IMPORT_CALL_LOG)
} else {
Toast.makeText(
this,
getString(R.string.call_logs_read_write_permissions_required),
Toast.LENGTH_LONG
).show()
val statusReportText: TextView = findViewById(R.id.status_report)
statusReportText.text = getString(R.string.call_logs_read_write_permissions_required)
statusReportText.visibility = View.VISIBLE
}
}

Expand All @@ -255,11 +247,9 @@ class MainActivity : AppCompatActivity(), ConfirmWipeFragment.NoticeDialogListen
}
startActivityForResult(intent, EXPORT_CONTACTS)
} else {
Toast.makeText(
this,
getString(R.string.contacts_read_permission_required),
Toast.LENGTH_LONG
).show()
val statusReportText: TextView = findViewById(R.id.status_report)
statusReportText.text = getString(R.string.contacts_read_permission_required)
statusReportText.visibility = View.VISIBLE
}
}

Expand All @@ -272,23 +262,19 @@ class MainActivity : AppCompatActivity(), ConfirmWipeFragment.NoticeDialogListen
}
startActivityForResult(intent, IMPORT_CONTACTS)
} else {
Toast.makeText(
this,
getString(R.string.contacts_write_permissions_required),
Toast.LENGTH_LONG
).show()
val statusReportText: TextView = findViewById(R.id.status_report)
statusReportText.text = getString(R.string.contacts_write_permissions_required)
statusReportText.visibility = View.VISIBLE
}
}

private fun wipeMessagesManual() {
if (Telephony.Sms.getDefaultSmsPackage(this) == this.packageName) {
ConfirmWipeFragment().show(supportFragmentManager, "wipe")
} else {
Toast.makeText(
this@MainActivity,
getString(R.string.default_sms_app_requirement),
Toast.LENGTH_LONG
).show()
val statusReportText: TextView = findViewById(R.id.status_report)
statusReportText.text = getString(R.string.default_sms_app_requirement)
statusReportText.visibility = View.VISIBLE
}
}

Expand Down

0 comments on commit 3c2084d

Please sign in to comment.