diff --git a/app/build.gradle b/app/build.gradle index cc8bbebe..af6f9281 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -14,7 +14,7 @@ android { defaultConfig { applicationId "com.simplemobiletools.calculator" - minSdkVersion 21 + minSdkVersion 23 targetSdkVersion 33 versionCode 56 versionName "5.10.2" @@ -63,7 +63,7 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:2e9ca234a7' + implementation 'com.github.SimpleMobileTools:Simple-Commons:a6032f9c07' implementation 'me.grantland:autofittextview:0.2.1' implementation 'net.objecthunter:exp4j:0.4.8' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f5582e36..602df2f3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -46,6 +46,7 @@ @@ -58,12 +59,14 @@ diff --git a/app/src/main/kotlin/com/simplemobiletools/calculator/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calculator/activities/MainActivity.kt index 2c4460c8..03c18d4a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calculator/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calculator/activities/MainActivity.kt @@ -34,6 +34,7 @@ class MainActivity : SimpleActivity(), Calculator { setContentView(R.layout.activity_main) appLaunched(BuildConfig.APPLICATION_ID) setupOptionsMenu() + refreshMenuItems() calc = CalculatorImpl(this, applicationContext) @@ -114,6 +115,7 @@ class MainActivity : SimpleActivity(), Calculator { main_toolbar.setOnMenuItemClickListener { menuItem -> when (menuItem.itemId) { R.id.history -> showHistory() + R.id.more_apps_from_us -> launchMoreAppsFromUsIntent() R.id.settings -> launchSettings() R.id.about -> launchAbout() else -> return@setOnMenuItemClickListener false @@ -122,6 +124,12 @@ class MainActivity : SimpleActivity(), Calculator { } } + private fun refreshMenuItems() { + main_toolbar.menu.apply { + findItem(R.id.more_apps_from_us).isVisible = !resources.getBoolean(R.bool.hide_google_relations) + } + } + private fun storeStateVariables() { config.apply { storedTextColor = textColor diff --git a/app/src/main/res/layout-land/activity_main.xml b/app/src/main/res/layout-land/activity_main.xml index 30cc16b1..34017df6 100644 --- a/app/src/main/res/layout-land/activity_main.xml +++ b/app/src/main/res/layout-land/activity_main.xml @@ -3,36 +3,27 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/main_coordinator" - android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.simplemobiletools.calculator.activities.MainActivity" tools:ignore="HardcodedText"> - - - - - + android:layout_height="?attr/actionBarSize" + android:background="@color/color_primary" + app:menu="@menu/menu" + app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" /> + android:orientation="vertical"> - - - - - + android:layout_height="?attr/actionBarSize" + android:background="@color/color_primary" + app:menu="@menu/menu" + app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" /> + android:layout_marginTop="?attr/actionBarSize" /> diff --git a/app/src/main/res/menu/menu.xml b/app/src/main/res/menu/menu.xml index d7d1fce8..638472c2 100644 --- a/app/src/main/res/menu/menu.xml +++ b/app/src/main/res/menu/menu.xml @@ -6,14 +6,19 @@ android:icon="@drawable/ic_clock_vector" android:title="@string/history" app:showAsAction="always" /> + + app:showAsAction="always" /> + app:showAsAction="always" /> diff --git a/build.gradle b/build.gradle index 1fbde4f9..8b150fcb 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:7.3.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong