Skip to content

Commit

Permalink
changelogs/182.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshnsears committed Nov 12, 2024
1 parent e092b13 commit 954e80f
Show file tree
Hide file tree
Showing 51 changed files with 743 additions and 535 deletions.
4 changes: 2 additions & 2 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/deviceManager.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion QuoteUnquote.cloudLib
2 changes: 1 addition & 1 deletion QuoteUnquote.utilsLib
32 changes: 13 additions & 19 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ android {
applicationId "com.github.jameshnsears.quoteunquote"

// changelog version | min sdk | target sdk
versionCode 1812435
versionCode 1822435
// semantic versioning
versionName "4.46.1"
versionName "4.47.0"

vectorDrawables.useSupportLibrary = true

Expand Down Expand Up @@ -232,25 +232,31 @@ dependencies {
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.3.0'
androidTestImplementation 'io.mockk:mockk-android:1.13.13'
androidTestImplementation 'org.jetbrains.kotlin:kotlin-test-junit:2.0.21'

annotationProcessor 'androidx.room:room-compiler:2.6.1'

debugImplementation 'androidx.compose.ui:ui-tooling-preview'
debugImplementation 'androidx.fragment:fragment-testing:1.8.5'
debugImplementation 'androidx.test:core-ktx:1.6.1'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.14'

googleplayImplementation platform('com.google.firebase:firebase-bom:33.5.1')

implementation 'androidx.activity:activity-compose'
implementation 'androidx.activity:activity-ktx:1.9.3'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.compose.material3:material3'
implementation 'androidx.compose.material:material'
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.ui:ui-tooling'
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
implementation 'androidx.core:core-ktx'
implementation 'androidx.core:core-ktx:1.15.0'
implementation 'androidx.databinding:databinding-runtime:8.7.2'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.room:room-guava:2.6.1'
implementation 'androidx.room:room-runtime:2.6.1'
implementation 'androidx.room:room-rxjava2:2.6.1'
implementation 'androidx.work:work-runtime:2.10.0'
implementation 'androidx.work:work-runtime-ktx:2.10.0'
implementation 'com.github.skydoves:colorpickerpreference:2.0.6'
implementation 'com.google.android.material:material:1.12.0'
implementation 'com.google.code.gson:gson:2.11.0'
Expand All @@ -264,21 +270,9 @@ dependencies {
implementation 'net.pwall.json:json-kotlin-schema:0.50'
implementation 'org.apache.commons:commons-csv:1.12.0'
implementation 'org.jsoup:jsoup:1.18.1'
implementation 'androidx.work:work-runtime-ktx:2.10.0'
implementation 'androidx.work:work-runtime:2.10.0'
implementation platform('androidx.compose:compose-bom:2024.10.01')
implementation project(path: ':cloudLib')
implementation project(path: ':utilsLib')

implementation platform('androidx.compose:compose-bom:2024.10.01')
debugImplementation 'androidx.compose.ui:ui-tooling-preview'
implementation 'androidx.activity:activity-compose'
implementation 'androidx.compose.material3:material3'
implementation 'androidx.compose.material:material'
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.ui:ui-tooling'
implementation 'androidx.core:core-ktx'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx'

testImplementation 'androidx.arch.core:core-testing:2.2.0'
testImplementation 'androidx.room:room-testing:2.6.1'
testImplementation 'androidx.test:core-ktx:1.6.1'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"formatVersion": 1,
"database": {
"version": 47,
"version": 48,
"identityHash": "4576f076a1896260b13b26d1a0d40a61",
"entities": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class FilesCsvInPlaceEditDialogTest : QuoteUnquoteModelUtility() {
)

scenario.onFragment { contentCsvInPlaceEditDialog ->
assertTrue(contentCsvInPlaceEditDialog.quoteUnquoteModel.allQuotations.size == 20272)
assertTrue(contentCsvInPlaceEditDialog.quoteUnquoteModel.allQuotations.size == 20267)
}

composeRule.onNodeWithText("Save").assertExists().performClick()
Expand Down
Binary file modified app/src/main/assets/quotations.db.prod
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;

import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
Expand All @@ -15,6 +16,7 @@

import com.github.jameshnsears.quoteunquote.QuoteUnquoteWidget;
import com.github.jameshnsears.quoteunquote.R;
import com.github.jameshnsears.quoteunquote.configure.fragment.FragmentCommon;
import com.github.jameshnsears.quoteunquote.configure.fragment.appearance.AppearanceFragment;
import com.github.jameshnsears.quoteunquote.configure.fragment.notifications.NotificationsFragment;
import com.github.jameshnsears.quoteunquote.configure.fragment.quotations.QuotationsFragment;
Expand Down Expand Up @@ -124,25 +126,63 @@ protected void init() {

createListenerBottomNavigationView();

activityConfigureBinding.configureNavigation.setSelectedItemId(R.id.navigationBarQuotations);
routeToLastScreen();
}

protected void routeToLastScreen() {
String screen =
new QuotationsPreferences(widgetId, getApplicationContext()).getScreen();

if (!screen.equals("")) {
switch (FragmentCommon.Screen.fromString(screen)) {
case QuotationsFilter:
case ContentInternal:
case ContentFiles:
case ContentWeb:
activityConfigureBinding.configureNavigation.setSelectedItemId(R.id.navigationBarQuotations);
break;
case AppearanceStyle:
case AppearanceToolbar:
activityConfigureBinding.configureNavigation.setSelectedItemId(R.id.navigationBarAppearance);
break;
case Notifications:
activityConfigureBinding.configureNavigation.setSelectedItemId(R.id.navigationBarNotification);
break;
case Sync:
activityConfigureBinding.configureNavigation.setSelectedItemId(R.id.navigationBarSync);
break;
}
} else {
activityConfigureBinding.configureNavigation.setSelectedItemId(R.id.navigationBarQuotations);
}
}

protected void createListenerBottomNavigationView() {
activityConfigureBinding.configureNavigation.setOnItemSelectedListener(item -> {
Fragment selectedFragment = getFragmentContentNewInstance();

String screen =
new QuotationsPreferences(widgetId, getApplicationContext()).getScreen();

switch (item.getItemId()) {
case R.id.navigationBarQuotations:
selectedFragment = getFragmentContentNewInstance();
enableDisableMenuToHelpWithRouting(false, true, true, true);
break;
case R.id.navigationBarAppearance:
selectedFragment = AppearanceFragment.newInstance(widgetId);
activityConfigureBinding.configureNavigation.getMenu().findItem(R.id.navigationBarQuotations).setEnabled(true);
enableDisableMenuToHelpWithRouting(true, false, true, true);
break;
case R.id.navigationBarNotification:
selectedFragment = NotificationsFragment.newInstance(widgetId);
activityConfigureBinding.configureNavigation.getMenu().findItem(R.id.navigationBarQuotations).setEnabled(true);
enableDisableMenuToHelpWithRouting(true, true, false, true);
break;
case R.id.navigationBarSync:
selectedFragment = SyncFragment.newInstance(widgetId);
activityConfigureBinding.configureNavigation.getMenu().findItem(R.id.navigationBarQuotations).setEnabled(true);
enableDisableMenuToHelpWithRouting(true, true, true, false);
break;
default:
Timber.e("%d", item.getItemId());
Expand All @@ -159,6 +199,19 @@ protected void createListenerBottomNavigationView() {
});
}

private void enableDisableMenuToHelpWithRouting(
final boolean navigationBarQuotations,
final boolean navigationBarAppearance,
final boolean navigationBarNotification,
final boolean navigationBarSync
) {
Menu menu = activityConfigureBinding.configureNavigation.getMenu();
menu.findItem(R.id.navigationBarQuotations).setEnabled(navigationBarQuotations);
menu.findItem(R.id.navigationBarAppearance).setEnabled(navigationBarAppearance);
menu.findItem(R.id.navigationBarNotification).setEnabled(navigationBarNotification);
menu.findItem(R.id.navigationBarSync).setEnabled(navigationBarSync);
}

private void linkToWikipedia(@NonNull final String wikipedia) {
Timber.d("wikipedia=%s", wikipedia);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package com.github.jameshnsears.quoteunquote.configure.fragment;

import android.content.Context;
import android.widget.Button;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;

import com.github.jameshnsears.quoteunquote.configure.fragment.quotations.QuotationsPreferences;

import timber.log.Timber;

public class FragmentCommon extends Fragment {
Expand All @@ -22,4 +25,37 @@ public FragmentCommon(final int theWidgetId) {
public void makeButtonAlpha(@NonNull final Button button, final boolean enable) {
button.setAlpha(enable ? 1 : 0.25f);
}

public void rememberScreen(final Screen screen, Context applicationContext) {
new QuotationsPreferences(widgetId, applicationContext).setScreen(screen.name);
}

public enum Screen {
QuotationsFilter("QuotationsFilter"),
ContentInternal("ContentInternal"),
ContentFiles("ContentFiles"),
ContentWeb("ContentWeb"),

AppearanceStyle("AppearanceStyle"),
AppearanceToolbar("AppearanceToolbar"),

Notifications("Notifications"),

Sync("Sync");

public final String name;

Screen(String name) {
this.name = name;
}

public static Screen fromString(String name) {
for (Screen screen : Screen.values()) {
if (screen.name.equalsIgnoreCase(name)) {
return screen;
}
}
throw new IllegalArgumentException("No enum constant with name " + name);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import com.github.jameshnsears.quoteunquote.R;
import com.github.jameshnsears.quoteunquote.configure.fragment.FragmentCommon;
import com.github.jameshnsears.quoteunquote.configure.fragment.quotations.QuotationsPreferences;
import com.github.jameshnsears.quoteunquote.databinding.FragmentAppearanceBinding;
import com.google.android.material.tabs.TabLayoutMediator;

Expand Down Expand Up @@ -77,12 +78,21 @@ public void onPageSelected(int position) {
getString(R.string.fragment_appearance_tab_style),
getString(R.string.fragment_appearance_navigation)
};

new TabLayoutMediator(
fragmentAppearanceBinding.tabLayout,
fragmentAppearanceBinding.viewPager2Appearance,
true,
false,
(tab, position) -> tab.setText(tabs[position])).attach();

String screen =
new QuotationsPreferences(widgetId, getContext()).getScreen();
if (screen.equals(Screen.AppearanceToolbar.name)) {
fragmentAppearanceBinding.viewPager2Appearance.setCurrentItem(1);
} else {
fragmentAppearanceBinding.viewPager2Appearance.setCurrentItem(0);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ public class AppearanceStyleFragment extends FragmentCommon {
@Nullable
public AppearancePreferences appearancePreferences;

@Override
public void onResume() {
super.onResume();
rememberScreen(Screen.AppearanceStyle, getContext());
}

public AppearanceStyleFragment() {
// dark mode support
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ public class AppearanceToolbarFragment extends FragmentCommon {
@Nullable
public AppearancePreferences appearancePreferences;

@Override
public void onResume() {
super.onResume();
rememberScreen(Screen.AppearanceToolbar, getContext());
}

public AppearanceToolbarFragment() {
// dark mode support
}
Expand Down Expand Up @@ -64,7 +70,6 @@ public void onDestroyView() {
@Override
public void onViewCreated(
@NonNull final View view, @NonNull final Bundle savedInstanceState) {

createListenerToolbarColourPicker();
createListenerToolbarFirst();
createListenerToolbarPrevious();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ public class NotificationsFragment extends FragmentCommon {
}
);

@Override
public void onResume() {
super.onResume();
rememberScreen(Screen.Notifications, getContext());

handleSpecialPermissionForExactAlarm();
}

public NotificationsFragment() {
// dark mode support
}
Expand Down Expand Up @@ -348,13 +356,6 @@ private void createListenerDeviceUnlock() {
});
}

@Override
public void onResume() {
super.onResume();

handleSpecialPermissionForExactAlarm();
}

private void createListenerDaily() {
final CheckBox checkBoxDailyAt = fragmentNotificationsBinding.checkBoxDailyAt;
checkBoxDailyAt.setOnCheckedChangeListener((buttonView, isChecked) -> {
Expand Down
Loading

0 comments on commit 954e80f

Please sign in to comment.