Skip to content

Commit

Permalink
Build91
Browse files Browse the repository at this point in the history
  - Fixed the crash that occurred unexpectedly
  • Loading branch information
Hamza417 committed Aug 29, 2023
1 parent 15ee405 commit 7c945bd
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 13 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ android {
applicationId "app.simple.inure"
minSdkVersion 23
targetSdkVersion 34
versionCode 90
versionName "build90"
versionCode 91
versionName "build91"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down
7 changes: 6 additions & 1 deletion app/src/main/assets/html/changelogs.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1>Change Logs</h1>
<br>

<sub>(Current Version)</sub>
<h2>Build90</h2>
<h2>Build91</h2>

<!-- Write change logs here -->

Expand Down Expand Up @@ -73,6 +73,11 @@ <h4>Changes</h4>

<br>
<br>
<br>
<p>
Build90 was skipped.
</p>
<br>
<div class="wrap-collapsible">
<input class="toggle" id="build_89" type="checkbox">
<label class="lbl-toggle" for="build_89">Build89</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class AdapterTags(private val tags: ArrayList<String>, private val showNewTag: B
}

override fun onBindViewHolder(holder: Holder, position: Int) {
if (tags.size == 0 || position == tags.size) {
if (position == tags.size && showNewTag) {
holder.tag.text = holder.itemView.context.getString(R.string.add_tag)
holder.tag.setChipIconResource(R.drawable.ic_add)
holder.tag.chipStartPadding = 25F
Expand Down Expand Up @@ -81,14 +81,10 @@ class AdapterTags(private val tags: ArrayList<String>, private val showNewTag: B
}

override fun getItemCount(): Int {
return if (tags.size == 0) {
1
return if (showNewTag) {
tags.size.plus(1)
} else {
if (showNewTag) {
tags.size.plus(1)
} else {
tags.size
}
tags.size
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ public interface SearchViewEventListener {
void onSearchTextChanged(@NotNull String keywords, int count);

void onSearchRefreshPressed(View button);

void onClear(View button);
}
11 changes: 10 additions & 1 deletion app/src/main/java/app/simple/inure/ui/launcher/SplashScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class SplashScreen : ScopedFragment() {
private var isFrequentlyUsedLoaded = false
private var isBatteryOptimizationLoaded = false
private var isBootManagerLoaded = false
private var isTagsLoaded = false

private val launcherViewModel: LauncherViewModel by viewModels()

Expand Down Expand Up @@ -172,6 +173,7 @@ class SplashScreen : ScopedFragment() {
val batchViewModel = ViewModelProvider(requireActivity())[BatchViewModel::class.java]
val notesViewModel = ViewModelProvider(requireActivity())[NotesViewModel::class.java]
val apkBrowserViewModel = ViewModelProvider(requireActivity())[ApkBrowserViewModel::class.java]
val tagsViewModel = ViewModelProvider(requireActivity())[TagsViewModel::class.java]

val batteryOptimizationViewModel = if (ConfigurationPreferences.isUsingRoot() || ConfigurationPreferences.isUsingShizuku()) {
ViewModelProvider(requireActivity())[BatteryOptimizationViewModel::class.java]
Expand Down Expand Up @@ -267,6 +269,12 @@ class SplashScreen : ScopedFragment() {
openApp()
}

tagsViewModel.getTags().observe(viewLifecycleOwner) {
Log.d(TAG, "Tags data loaded in ${(System.currentTimeMillis() - startTime) / 1000} seconds")
isTagsLoaded = true
openApp()
}

/**
* One shell warning is enough, I guess!!
* Skip the boot manager ones if the user has already seen the warning
Expand Down Expand Up @@ -340,7 +348,8 @@ class SplashScreen : ScopedFragment() {
isBatteryOptimizationLoaded &&
isBatchLoaded &&
isBootManagerLoaded &&
isNotesLoaded
isNotesLoaded &&
isTagsLoaded
}

private fun checkForPermission(): Boolean {
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/app/simple/inure/ui/panels/Search.kt
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ class Search : KeyboardScopedFragment(), SharedPreferences.OnSharedPreferenceCha
override fun onSearchRefreshPressed(button: View?) {
searchViewModel.reload()
}

override fun onClear(button: View?) {
setTagsStripState("")
}
})
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,6 @@
<string name="backup_and_restore_desc">Backup and Restore app\'s data.</string>
<string name="import_">Import</string>
<string name="tags">Tags</string>
<string name="add_tag">Assign a Tag</string>
<string name="add_tag">Add a New Tag</string>
<string name="new_update_available">New update available</string>
</resources>

0 comments on commit 7c945bd

Please sign in to comment.