diff --git a/.github/ISSUE_TEMPLATE/report_issue.yml b/.github/ISSUE_TEMPLATE/report_issue.yml index e0a417b3f..d0766690f 100644 --- a/.github/ISSUE_TEMPLATE/report_issue.yml +++ b/.github/ISSUE_TEMPLATE/report_issue.yml @@ -44,7 +44,7 @@ body: label: Kotatsu version description: You can find your Kotatsu version in **Settings → About**. placeholder: | - Example: "3.3" + Example: "3.3.1" validations: required: true @@ -85,9 +85,9 @@ body: required: true - label: I have written a short but informative title. required: true - - label: If this is an issue with a source, I should be opening an issue in the [parsers repository](https://github.com/nv95/kotatsu-parsers/issues/new). + - label: If this is an issue with a source, I should be opening an issue in the [parsers repository](https://github.com/KotatsuApp/kotatsu-parsers/issues/new). required: true - - label: I have updated the app to version **[3.3](https://github.com/nv95/Kotatsu/releases/latest)**. + - label: I have updated the app to version **[3.3.1](https://github.com/KotatsuApp/Kotatsu/releases/latest)**. required: true - label: I will fill out all of the requested information in this form. required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/request_feature.yml b/.github/ISSUE_TEMPLATE/request_feature.yml index d4b373203..7bd0e002e 100644 --- a/.github/ISSUE_TEMPLATE/request_feature.yml +++ b/.github/ISSUE_TEMPLATE/request_feature.yml @@ -31,9 +31,9 @@ body: required: true - label: I have written a short but informative title. required: true - - label: If this is an issue with a source, I should be opening an issue in the [parsers repository](https://github.com/nv95/kotatsu-parsers/issues/new). + - label: If this is an issue with a source, I should be opening an issue in the [parsers repository](https://github.com/KotatsuApp/kotatsu-parsers/issues/new). required: true - - label: I have updated the app to version **[3.3](https://github.com/nv95/Kotatsu/releases/latest)**. + - label: I have updated the app to version **[3.3.1](https://github.com/KotatsuApp/Kotatsu/releases/latest)**. required: true - label: I will fill out all of the requested information in this form. required: true \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index cce90f79b..8ab8a1cad 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -77,7 +77,7 @@ afterEvaluate { } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) - implementation('com.github.nv95:kotatsu-parsers:8a3b6df91d') { + implementation('com.github.nv95:kotatsu-parsers:c92f89f307') { exclude group: 'org.json', module: 'json' } @@ -86,10 +86,10 @@ dependencies { implementation 'androidx.core:core-ktx:1.8.0' implementation 'androidx.activity:activity-ktx:1.5.0-rc01' implementation 'androidx.fragment:fragment-ktx:1.5.0-rc01' - implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.0-rc01' - implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.0-rc01' - implementation 'androidx.lifecycle:lifecycle-service:2.5.0-rc01' - implementation 'androidx.lifecycle:lifecycle-process:2.5.0-rc01' + implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.0-rc02' + implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.0-rc02' + implementation 'androidx.lifecycle:lifecycle-service:2.5.0-rc02' + implementation 'androidx.lifecycle:lifecycle-process:2.5.0-rc02' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' implementation 'androidx.recyclerview:recyclerview:1.2.1' @@ -99,7 +99,7 @@ dependencies { implementation 'androidx.biometric:biometric-ktx:1.2.0-alpha04' implementation 'com.google.android.material:material:1.7.0-alpha02' //noinspection LifecycleAnnotationProcessorWithJava8 - kapt 'androidx.lifecycle:lifecycle-compiler:2.5.0-rc01' + kapt 'androidx.lifecycle:lifecycle-compiler:2.5.0-rc02' implementation 'androidx.room:room-runtime:2.4.2' implementation 'androidx.room:room-ktx:2.4.2' diff --git a/app/src/main/java/org/koitharu/kotatsu/core/prefs/AppSettings.kt b/app/src/main/java/org/koitharu/kotatsu/core/prefs/AppSettings.kt index 547e1635c..e89a782df 100644 --- a/app/src/main/java/org/koitharu/kotatsu/core/prefs/AppSettings.kt +++ b/app/src/main/java/org/koitharu/kotatsu/core/prefs/AppSettings.kt @@ -41,7 +41,7 @@ class AppSettings(context: Context) { get() = Collections.unmodifiableSet(remoteSources) var listMode: ListMode - get() = prefs.getEnumValue(KEY_LIST_MODE, ListMode.DETAILED_LIST) + get() = prefs.getEnumValue(KEY_LIST_MODE, ListMode.GRID) set(value) = prefs.edit { putEnumValue(KEY_LIST_MODE, value) } var defaultSection: AppSection diff --git a/app/src/main/java/org/koitharu/kotatsu/favourites/ui/categories/edit/FavouritesCategoryEditActivity.kt b/app/src/main/java/org/koitharu/kotatsu/favourites/ui/categories/edit/FavouritesCategoryEditActivity.kt index b38dfec26..96de7ea86 100644 --- a/app/src/main/java/org/koitharu/kotatsu/favourites/ui/categories/edit/FavouritesCategoryEditActivity.kt +++ b/app/src/main/java/org/koitharu/kotatsu/favourites/ui/categories/edit/FavouritesCategoryEditActivity.kt @@ -3,8 +3,6 @@ package org.koitharu.kotatsu.favourites.ui.categories.edit import android.content.Context import android.content.Intent import android.os.Bundle -import android.view.Menu -import android.view.MenuItem import android.view.View import android.view.ViewGroup import android.widget.AdapterView @@ -24,7 +22,8 @@ import org.koitharu.kotatsu.favourites.ui.categories.CategoriesActivity import org.koitharu.kotatsu.parsers.model.SortOrder import org.koitharu.kotatsu.utils.ext.getDisplayMessage -class FavouritesCategoryEditActivity : BaseActivity(), AdapterView.OnItemClickListener { +class FavouritesCategoryEditActivity : BaseActivity(), AdapterView.OnItemClickListener, + View.OnClickListener { private val viewModel by viewModel { parametersOf(intent.getLongExtra(EXTRA_ID, NO_ID)) @@ -39,6 +38,7 @@ class FavouritesCategoryEditActivity : BaseActivity setHomeAsUpIndicator(com.google.android.material.R.drawable.abc_ic_clear_material) } initSortSpinner() + binding.buttonDone.setOnClickListener(this) viewModel.onSaved.observe(this) { finishAfterTransition() } viewModel.category.observe(this, ::onCategoryChanged) @@ -62,22 +62,14 @@ class FavouritesCategoryEditActivity : BaseActivity } } - override fun onCreateOptionsMenu(menu: Menu): Boolean { - menuInflater.inflate(R.menu.opt_config, menu) - menu.findItem(R.id.action_done)?.setTitle(R.string.save) - return super.onCreateOptionsMenu(menu) - } - - override fun onOptionsItemSelected(item: MenuItem) = when (item.itemId) { - R.id.action_done -> { - viewModel.save( + override fun onClick(v: View) { + when (v.id) { + R.id.button_done -> viewModel.save( title = binding.editName.text?.toString().orEmpty(), sortOrder = getSelectedSortOrder(), isTrackerEnabled = binding.switchTracker.isChecked, ) - true } - else -> super.onOptionsItemSelected(item) } override fun onWindowInsetsChanged(insets: Insets) { diff --git a/app/src/main/java/org/koitharu/kotatsu/favourites/ui/categories/select/FavouriteCategoriesBottomSheet.kt b/app/src/main/java/org/koitharu/kotatsu/favourites/ui/categories/select/FavouriteCategoriesBottomSheet.kt index aa2bacbbe..f13cce9a7 100644 --- a/app/src/main/java/org/koitharu/kotatsu/favourites/ui/categories/select/FavouriteCategoriesBottomSheet.kt +++ b/app/src/main/java/org/koitharu/kotatsu/favourites/ui/categories/select/FavouriteCategoriesBottomSheet.kt @@ -2,11 +2,9 @@ package org.koitharu.kotatsu.favourites.ui.categories.select import android.os.Bundle import android.view.LayoutInflater -import android.view.MenuItem import android.view.View import android.view.ViewGroup import android.widget.Toast -import androidx.appcompat.widget.Toolbar import androidx.fragment.app.FragmentManager import org.koin.androidx.viewmodel.ext.android.viewModel import org.koin.core.parameter.parametersOf @@ -28,7 +26,7 @@ class FavouriteCategoriesBottomSheet : BaseBottomSheet(), OnListItemClickListener, CategoriesEditDelegate.CategoriesEditCallback, - Toolbar.OnMenuItemClickListener, View.OnClickListener { + View.OnClickListener { private val viewModel by viewModel { parametersOf(requireNotNull(arguments?.getParcelableArrayList(KEY_MANGA_LIST)).map { it.manga }) @@ -45,7 +43,7 @@ class FavouriteCategoriesBottomSheet : super.onViewCreated(view, savedInstanceState) adapter = MangaCategoriesAdapter(this) binding.recyclerViewCategories.adapter = adapter - binding.toolbar.setOnMenuItemClickListener(this) + binding.buttonDone.setOnClickListener(this) binding.itemCreate.setOnClickListener(this) viewModel.content.observe(viewLifecycleOwner, this::onContentChanged) @@ -57,19 +55,10 @@ class FavouriteCategoriesBottomSheet : super.onDestroyView() } - override fun onMenuItemClick(item: MenuItem): Boolean { - return when (item.itemId) { - R.id.action_done -> { - dismiss() - true - } - else -> false - } - } - override fun onClick(v: View) { when (v.id) { R.id.item_create -> startActivity(FavouritesCategoryEditActivity.newIntent(requireContext())) + R.id.button_done -> dismiss() } } diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/sources/SourcesSettingsFragment.kt b/app/src/main/java/org/koitharu/kotatsu/settings/sources/SourcesSettingsFragment.kt index e8044fdde..10453c27e 100644 --- a/app/src/main/java/org/koitharu/kotatsu/settings/sources/SourcesSettingsFragment.kt +++ b/app/src/main/java/org/koitharu/kotatsu/settings/sources/SourcesSettingsFragment.kt @@ -106,7 +106,13 @@ class SourcesSettingsFragment : searchView.queryHint = searchMenuItem.title } - override fun onMenuItemSelected(menuItem: MenuItem): Boolean = false + override fun onMenuItemSelected(menuItem: MenuItem): Boolean = when (menuItem.itemId) { + R.id.action_disable_all -> { + viewModel.disableAll() + true + } + else -> false + } override fun onMenuItemActionExpand(item: MenuItem?): Boolean { (activity as? AppBarOwner)?.appBar?.setExpanded(false, true) diff --git a/app/src/main/java/org/koitharu/kotatsu/settings/sources/SourcesSettingsViewModel.kt b/app/src/main/java/org/koitharu/kotatsu/settings/sources/SourcesSettingsViewModel.kt index da3eba14f..3a5340fe8 100644 --- a/app/src/main/java/org/koitharu/kotatsu/settings/sources/SourcesSettingsViewModel.kt +++ b/app/src/main/java/org/koitharu/kotatsu/settings/sources/SourcesSettingsViewModel.kt @@ -7,6 +7,7 @@ import org.koitharu.kotatsu.base.ui.BaseViewModel import org.koitharu.kotatsu.core.model.getLocaleTitle import org.koitharu.kotatsu.core.prefs.AppSettings import org.koitharu.kotatsu.parsers.model.MangaSource +import org.koitharu.kotatsu.parsers.util.mapToSet import org.koitharu.kotatsu.parsers.util.toTitleCase import org.koitharu.kotatsu.settings.sources.model.SourceConfigItem import org.koitharu.kotatsu.utils.ext.map @@ -58,6 +59,13 @@ class SourcesSettingsViewModel( buildList() } + fun disableAll() { + settings.hiddenSources = settings.getMangaSources(includeHidden = true).mapToSet { + it.name + } + buildList() + } + fun expandOrCollapse(headerId: String?) { if (headerId in expandedGroups) { expandedGroups.remove(headerId) diff --git a/app/src/main/java/org/koitharu/kotatsu/widget/shelf/ShelfConfigActivity.kt b/app/src/main/java/org/koitharu/kotatsu/widget/shelf/ShelfConfigActivity.kt index b7eea4171..b404b3286 100644 --- a/app/src/main/java/org/koitharu/kotatsu/widget/shelf/ShelfConfigActivity.kt +++ b/app/src/main/java/org/koitharu/kotatsu/widget/shelf/ShelfConfigActivity.kt @@ -4,11 +4,10 @@ import android.app.Activity import android.appwidget.AppWidgetManager import android.content.Intent import android.os.Bundle -import android.view.Menu -import android.view.MenuItem import android.view.View import android.view.ViewGroup import androidx.core.graphics.Insets +import androidx.core.view.isVisible import androidx.core.view.updateLayoutParams import androidx.core.view.updatePadding import androidx.recyclerview.widget.RecyclerView @@ -26,7 +25,7 @@ import org.koitharu.kotatsu.widget.shelf.model.CategoryItem import com.google.android.material.R as materialR class ShelfConfigActivity : BaseActivity(), - OnListItemClickListener { + OnListItemClickListener, View.OnClickListener { private val viewModel by viewModel() @@ -45,6 +44,8 @@ class ShelfConfigActivity : BaseActivity(), MaterialDividerItemDecoration(this, RecyclerView.VERTICAL) ) binding.recyclerView.adapter = adapter + binding.buttonDone.isVisible = true + binding.buttonDone.setOnClickListener(this) binding.fabAdd.hide() val appWidgetId = intent?.getIntExtra( AppWidgetManager.EXTRA_APPWIDGET_ID, @@ -61,23 +62,18 @@ class ShelfConfigActivity : BaseActivity(), viewModel.onError.observe(this, this::onError) } - override fun onCreateOptionsMenu(menu: Menu): Boolean { - menuInflater.inflate(R.menu.opt_config, menu) - return super.onCreateOptionsMenu(menu) - } - - override fun onOptionsItemSelected(item: MenuItem) = when (item.itemId) { - R.id.action_done -> { - config.categoryId = viewModel.checkedId - updateWidget() - setResult( - Activity.RESULT_OK, - Intent().putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, config.widgetId) - ) - finish() - true + override fun onClick(v: View) { + when (v.id) { + R.id.button_done -> { + config.categoryId = viewModel.checkedId + updateWidget() + setResult( + Activity.RESULT_OK, + Intent().putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, config.widgetId) + ) + finish() + } } - else -> super.onOptionsItemSelected(item) } override fun onItemClick(item: CategoryItem, view: View) { diff --git a/app/src/main/res/color-v23/selector_switch_thumb.xml b/app/src/main/res/color-v23/selector_switch_thumb.xml new file mode 100644 index 000000000..ef1a3cc36 --- /dev/null +++ b/app/src/main/res/color-v23/selector_switch_thumb.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/color-v23/selector_switch_track.xml b/app/src/main/res/color-v23/selector_switch_track.xml new file mode 100644 index 000000000..3779a794a --- /dev/null +++ b/app/src/main/res/color-v23/selector_switch_track.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/color/selector_switch_thumb.xml b/app/src/main/res/color/selector_switch_thumb.xml index ef1a3cc36..de8892285 100644 --- a/app/src/main/res/color/selector_switch_thumb.xml +++ b/app/src/main/res/color/selector_switch_thumb.xml @@ -1,7 +1,7 @@ - - - - + + + + \ No newline at end of file diff --git a/app/src/main/res/color/selector_switch_track.xml b/app/src/main/res/color/selector_switch_track.xml index 3779a794a..7b6c7c468 100644 --- a/app/src/main/res/color/selector_switch_track.xml +++ b/app/src/main/res/color/selector_switch_track.xml @@ -1,7 +1,7 @@ - - - - + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_expand_less.xml b/app/src/main/res/drawable/ic_expand_less.xml index 466a91a2e..86c53a93b 100644 --- a/app/src/main/res/drawable/ic_expand_less.xml +++ b/app/src/main/res/drawable/ic_expand_less.xml @@ -1,7 +1,11 @@ - \ No newline at end of file + android:width="24dp" + android:height="24dp" + android:tint="?attr/colorControlNormal" + android:viewportWidth="24" + android:viewportHeight="24"> + + diff --git a/app/src/main/res/drawable/ic_expand_more.xml b/app/src/main/res/drawable/ic_expand_more.xml index f7cae8b82..63e31a16f 100644 --- a/app/src/main/res/drawable/ic_expand_more.xml +++ b/app/src/main/res/drawable/ic_expand_more.xml @@ -1,7 +1,11 @@ - \ No newline at end of file + android:width="24dp" + android:height="24dp" + android:tint="?attr/colorControlNormal" + android:viewportWidth="24" + android:viewportHeight="24"> + + diff --git a/app/src/main/res/drawable/switch_thumb.xml b/app/src/main/res/drawable/switch_thumb.xml index 548ff3bd8..12222e7f5 100644 --- a/app/src/main/res/drawable/switch_thumb.xml +++ b/app/src/main/res/drawable/switch_thumb.xml @@ -7,7 +7,7 @@ android:right="4dp" android:top="4dp"> - + diff --git a/app/src/main/res/drawable/switch_track.xml b/app/src/main/res/drawable/switch_track.xml index ff149c727..005647294 100644 --- a/app/src/main/res/drawable/switch_track.xml +++ b/app/src/main/res/drawable/switch_track.xml @@ -3,7 +3,7 @@ xmlns:android="http://schemas.android.com/apk/res/android"> - + + android:layout_height="wrap_content" + android:fitsSystemWindows="true"> + app:layout_collapseMode="pin"> + +