Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b368fc91 authored by tibbi's avatar tibbi
Browse files

apply all selected colors on the main screen

parent dcd485c8
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ class MainActivity : SimpleActivity() {

    private var mBus: Bus? = null
    private var mCameraImpl: MyCameraImpl? = null
    private var translucentWhite = 0
    private var mStoredUseEnglish = false

    override fun onCreate(savedInstanceState: Bundle?) {
@@ -37,9 +36,7 @@ class MainActivity : SimpleActivity() {
        appLaunched()

        mBus = BusProvider.instance
        translucentWhite = resources.getColor(R.color.translucent_white)
        changeIconColor(translucentWhite, bright_display_btn)
        changeIconColor(translucentWhite, stroboscope_btn)
        changeIconColor(config.backgroundColor.getContrastColor(), stroboscope_btn)

        bright_display_btn.setOnClickListener {
            startActivity(Intent(applicationContext, BrightDisplayActivity::class.java))
@@ -63,13 +60,18 @@ class MainActivity : SimpleActivity() {
        mCameraImpl!!.handleCameraSetup()
        checkState(MyCameraImpl.isFlashlightOn)

        changeIconColor(config.backgroundColor.getContrastColor(), bright_display_btn)
        bright_display_btn.beVisibleIf(config.brightDisplay)
        stroboscope_btn.beVisibleIf(config.stroboscope)
        if (!config.stroboscope) {
            mCameraImpl!!.stopStroboscope()
            stroboscope_bar.beInvisible()
        }

        updateTextColors(main_holder)
        if (stroboscope_bar.isInvisible()) {
            changeIconColor(config.backgroundColor.getContrastColor(), stroboscope_btn)
        }
    }

    override fun onStart() {
@@ -169,8 +171,8 @@ class MainActivity : SimpleActivity() {

    private fun cameraPermissionGranted() {
        if (mCameraImpl!!.toggleStroboscope()) {
            stroboscope_bar.beInvisibleIf(stroboscope_bar.visibility == View.VISIBLE)
            changeIconColor(if (stroboscope_bar.visibility == View.VISIBLE) config.primaryColor else translucentWhite, stroboscope_btn)
            stroboscope_bar.beInvisibleIf(stroboscope_bar.isVisible())
            changeIconColor(if (stroboscope_bar.isVisible()) config.primaryColor else config.backgroundColor.getContrastColor(), stroboscope_btn)
        }
    }

@@ -196,12 +198,12 @@ class MainActivity : SimpleActivity() {
        changeIconColor(config.primaryColor, toggle_btn)
        window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)

        changeIconColor(translucentWhite, stroboscope_btn)
        changeIconColor(config.backgroundColor.getContrastColor(), stroboscope_btn)
        stroboscope_bar.beInvisible()
    }

    private fun disableFlashlight() {
        changeIconColor(translucentWhite, toggle_btn)
        changeIconColor(config.backgroundColor.getContrastColor(), toggle_btn)
        window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
    }

+2 −2
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
            android:shape="oval">
            <stroke
                android:width="13dp"
                android:color="@color/translucent_white"/>
                android:color="@android:color/white"/>
            <solid android:color="@android:color/transparent"/>
        </shape>
    </item>
@@ -33,7 +33,7 @@
            android:shape="oval">
            <stroke
                android:width="13dp"
                android:color="@color/translucent_white"/>
                android:color="@android:color/white"/>
            <solid android:color="@android:color/transparent"/>
        </shape>
    </item>
+0 −1
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@
    android:id="@+id/main_holder"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/black"
    android:gravity="center"
    android:orientation="vertical"
    android:padding="@dimen/activity_margin">
+4 −4
Original line number Diff line number Diff line
@@ -23,8 +23,8 @@

    <Button
        android:id="@+id/config_widget_color"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_width="@dimen/widget_colorpicker_size"
        android:layout_height="@dimen/widget_colorpicker_size"
        android:layout_above="@+id/config_save"/>

    <RelativeLayout
@@ -48,10 +48,10 @@
    <Button
        android:id="@+id/config_save"
        android:layout_width="wrap_content"
        android:layout_height="50dp"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:background="@color/translucent_black"
        android:background="@color/gradient_grey_start"
        android:fontFamily="sans-serif-light"
        android:paddingLeft="@dimen/activity_margin"
        android:paddingRight="@dimen/activity_margin"
+3 −2
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="translucent_white">#eeffffff</color>
    <color name="translucent_black">#88000000</color>
    <!-- Default colors -->
    <color name="default_text_color">@color/theme_dark_text_color</color>
    <color name="default_background_color">@color/theme_dark_background_color</color>
</resources>