Skip to content

Commit 1d6fbfe

Browse files
authored
Merge pull request #670 from esensar/release-crash-fix
Fix release build type crash and missing pager tab strip
2 parents be1a70c + 5969af5 commit 1d6fbfe

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

app/proguard-rules.pro

+6
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,9 @@
2525
public static <1> INSTANCE;
2626
kotlinx.serialization.KSerializer serializer(...);
2727
}
28+
29+
# Needed for using TypeToken with Gson
30+
# Taken from: https://r8.googlesource.com/r8/+/refs/heads/main/compatibility-faq.md#troubleshooting-gson-gson
31+
-keepattributes Signature
32+
-keep class com.google.gson.reflect.TypeToken { *; }
33+
-keep class * extends com.google.gson.reflect.TypeToken

app/src/main/kotlin/com/simplemobiletools/notes/pro/activities/MainActivity.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import android.webkit.WebViewClient
2727
import android.widget.ImageView
2828
import android.widget.TextView
2929
import android.widget.Toast
30+
import androidx.viewpager.widget.ViewPager
3031
import com.simplemobiletools.commons.dialogs.*
3132
import com.simplemobiletools.commons.extensions.*
3233
import com.simplemobiletools.commons.helpers.*
@@ -80,12 +81,11 @@ class MainActivity : SimpleActivity() {
8081
private lateinit var searchNextBtn: ImageView
8182
private lateinit var searchClearBtn: ImageView
8283

83-
private lateinit var binding: ActivityMainBinding
84+
private val binding: ActivityMainBinding by viewBinding(ActivityMainBinding::inflate)
8485

8586
override fun onCreate(savedInstanceState: Bundle?) {
8687
isMaterialActivity = true
8788
super.onCreate(savedInstanceState)
88-
binding = ActivityMainBinding.inflate(layoutInflater)
8989
setContentView(binding.root)
9090
appLaunched(BuildConfig.APPLICATION_ID)
9191
setupOptionsMenu()
@@ -103,6 +103,7 @@ class MainActivity : SimpleActivity() {
103103
binding.pagerTabStrip.setTextSize(TypedValue.COMPLEX_UNIT_PX, getPercentageFontSize())
104104
binding.pagerTabStrip.layoutParams.height =
105105
(binding.pagerTabStrip.height + resources.getDimension(com.simplemobiletools.commons.R.dimen.activity_margin) * 2 * (config.fontSizePercentage / 100f)).toInt()
106+
(binding.pagerTabStrip.layoutParams as ViewPager.LayoutParams).isDecor = true
106107
checkWhatsNewDialog()
107108
checkIntents(intent)
108109

app/src/main/kotlin/com/simplemobiletools/notes/pro/activities/SettingsActivity.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@ import kotlin.system.exitProcess
2727

2828
class SettingsActivity : SimpleActivity() {
2929
private val notesFileType = "application/json"
30-
private lateinit var binding: ActivitySettingsBinding
30+
private val binding: ActivitySettingsBinding by viewBinding(ActivitySettingsBinding::inflate)
3131

3232
override fun onCreate(savedInstanceState: Bundle?) {
3333
isMaterialActivity = true
3434
super.onCreate(savedInstanceState)
35-
binding = ActivitySettingsBinding.inflate(layoutInflater)
3635
setContentView(binding.root)
3736

3837
updateMaterialActivityViews(binding.settingsCoordinator, binding.settingsHolder, useTransparentNavigation = true, useTopSearchMenu = false)

app/src/main/kotlin/com/simplemobiletools/notes/pro/activities/WidgetConfigureActivity.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,12 @@ class WidgetConfigureActivity : SimpleActivity() {
4141
private var mIsCustomizingColors = false
4242
private var mShowTitle = false
4343
private var mNotes = listOf<Note>()
44-
private lateinit var binding: WidgetConfigBinding
44+
private val binding: WidgetConfigBinding by viewBinding(WidgetConfigBinding::inflate)
4545

4646
public override fun onCreate(savedInstanceState: Bundle?) {
4747
useDynamicTheme = false
4848
super.onCreate(savedInstanceState)
4949
setResult(RESULT_CANCELED)
50-
binding = WidgetConfigBinding.inflate(layoutInflater)
5150
setContentView(binding.root)
5251
initVariables()
5352

app/src/main/kotlin/com/simplemobiletools/notes/pro/fragments/ChecklistFragment.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
2828

2929
private var noteId = 0L
3030

31-
lateinit var binding: FragmentChecklistBinding
31+
private lateinit var binding: FragmentChecklistBinding
3232

3333
var items = mutableListOf<ChecklistItem>()
3434

0 commit comments

Comments
 (0)