do not color the action bar

This commit is contained in:
tibbi 2023-02-10 19:12:02 +01:00
parent f91137b770
commit 71171d7c15
3 changed files with 229 additions and 209 deletions

View File

@ -33,12 +33,16 @@ class MainActivity : SimpleActivity(), Calculator {
private lateinit var calc: CalculatorImpl private lateinit var calc: CalculatorImpl
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
isMaterialActivity = true
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main) setContentView(R.layout.activity_main)
appLaunched(BuildConfig.APPLICATION_ID) appLaunched(BuildConfig.APPLICATION_ID)
setupOptionsMenu() setupOptionsMenu()
refreshMenuItems() refreshMenuItems()
updateMaterialActivityViews(main_coordinator, null, useTransparentNavigation = false, useTopSearchMenu = false)
setupMaterialScrollListener(main_nested_scrollview, main_toolbar)
calc = CalculatorImpl(this, applicationContext) calc = CalculatorImpl(this, applicationContext)
btn_plus.setOnClickOperation(PLUS) btn_plus.setOnClickOperation(PLUS)

View File

@ -16,239 +16,247 @@
app:menu="@menu/menu" app:menu="@menu/menu"
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" /> app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
<LinearLayout <androidx.core.widget.NestedScrollView
android:id="@+id/calculator_holder" android:id="@+id/main_nested_scrollview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginTop="?attr/actionBarSize" android:layout_marginTop="?attr/actionBarSize"
android:hapticFeedbackEnabled="true" android:fillViewport="true"
android:layoutDirection="ltr" android:scrollbars="none">
android:orientation="vertical">
<TextView
android:id="@+id/formula"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2.1"
android:fontFamily="sans-serif-light"
android:gravity="end|bottom"
android:maxLines="1"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:textSize="@dimen/formula_text_size" />
<TextView
android:id="@+id/result"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.8"
android:fontFamily="sans-serif-light"
android:gravity="center_vertical|end"
android:maxLines="1"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:textSize="@dimen/display_text_size"
tools:text="0" />
<LinearLayout <LinearLayout
android:id="@+id/calculator_holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="2" android:hapticFeedbackEnabled="true"
android:orientation="horizontal"> android:layoutDirection="ltr"
android:orientation="vertical">
<TextView <TextView
android:id="@+id/btn_7" android:id="@+id/formula"
style="@style/MyButton"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="2.1"
android:text="7" /> android:fontFamily="sans-serif-light"
android:gravity="end|bottom"
android:maxLines="1"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:textSize="@dimen/formula_text_size" />
<TextView <TextView
android:id="@+id/btn_8" android:id="@+id/result"
style="@style/MyButton"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1.8"
android:text="8" /> android:fontFamily="sans-serif-light"
android:gravity="center_vertical|end"
android:maxLines="1"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:textSize="@dimen/display_text_size"
tools:text="0" />
<TextView <LinearLayout
android:id="@+id/btn_9"
style="@style/MyButton"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="2"
android:text="9" /> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/btn_divide" android:id="@+id/btn_7"
style="@style/MyButton" style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="7" />
<TextView
android:id="@+id/btn_8"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="8" />
<TextView
android:id="@+id/btn_9"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="9" />
<TextView
android:id="@+id/btn_divide"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="÷" />
<TextView
android:id="@+id/btn_clear"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="C" />
<TextView
android:id="@+id/btn_reset"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="AC"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="2"
android:text="÷" /> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/btn_clear" android:id="@+id/btn_4"
style="@style/MyButton" style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="4" />
<TextView
android:id="@+id/btn_5"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="5" />
<TextView
android:id="@+id/btn_6"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="6" />
<TextView
android:id="@+id/btn_multiply"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="×" />
<TextView
android:id="@+id/btn_root"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="√" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="2"
android:text="C" /> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/btn_reset" android:id="@+id/btn_1"
style="@style/MyButton" style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="1" />
<TextView
android:id="@+id/btn_2"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="2" />
<TextView
android:id="@+id/btn_3"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="3" />
<TextView
android:id="@+id/btn_minus"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="-" />
<TextView
android:id="@+id/btn_power"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="^" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="2"
android:text="AC" android:orientation="horizontal">
android:visibility="gone" />
<TextView
android:id="@+id/btn_0"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="0" />
<TextView
android:id="@+id/btn_decimal"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="." />
<TextView
android:id="@+id/btn_equals"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="=" />
<TextView
android:id="@+id/btn_plus"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="+" />
<TextView
android:id="@+id/btn_percent"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="%" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:orientation="horizontal">
<TextView
android:id="@+id/btn_4"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="4" />
<TextView
android:id="@+id/btn_5"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="5" />
<TextView
android:id="@+id/btn_6"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="6" />
<TextView
android:id="@+id/btn_multiply"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="×" />
<TextView
android:id="@+id/btn_root"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="√" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:orientation="horizontal">
<TextView
android:id="@+id/btn_1"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="1" />
<TextView
android:id="@+id/btn_2"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="2" />
<TextView
android:id="@+id/btn_3"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="3" />
<TextView
android:id="@+id/btn_minus"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="-" />
<TextView
android:id="@+id/btn_power"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="^" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:orientation="horizontal">
<TextView
android:id="@+id/btn_0"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="0" />
<TextView
android:id="@+id/btn_decimal"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="." />
<TextView
android:id="@+id/btn_equals"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="=" />
<TextView
android:id="@+id/btn_plus"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="+" />
<TextView
android:id="@+id/btn_percent"
style="@style/MyButton"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="%" />
</LinearLayout>
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -16,10 +16,18 @@
app:menu="@menu/menu" app:menu="@menu/menu"
app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" /> app:titleTextAppearance="@style/AppTheme.ActionBar.TitleTextStyle" />
<include <androidx.core.widget.NestedScrollView
layout="@layout/view_calculator" android:id="@+id/main_nested_scrollview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginTop="?attr/actionBarSize" /> android:layout_marginTop="?attr/actionBarSize"
android:fillViewport="true"
android:scrollbars="none">
<include
layout="@layout/view_calculator"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>