~oppen/latt

2c6ef8d467b0e509bd89b7ccbe078036c6d0e091 — Öppen 16 days ago 8d1879a
move about from bottomsheet to activity
7 files changed, 30 insertions(+), 34 deletions(-)

M app/src/main/AndroidManifest.xml
M app/src/main/java/oppen/filters/FeatureFlags.kt
M app/src/main/java/oppen/filters/ui/FilterActivity.kt
R app/src/main/java/oppen/filters/ui/about/{AboutBottomsheet.kt => AboutActivity.kt}
M app/src/main/java/oppen/filters/ui/views/OverflowMenu.kt
R app/src/main/res/layout/{bottomsheet_about.xml => activity_about.xml}
M app/src/main/res/layout/activity_main.xml
M app/src/main/AndroidManifest.xml => app/src/main/AndroidManifest.xml +2 -1
@@ 9,7 9,8 @@
        android:roundIcon="@drawable/vector_app_icon"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".ui.preferences.PreferencesActivity"></activity>
        <activity android:name=".ui.about.AboutActivity"></activity>
        <activity android:name=".ui.preferences.PreferencesActivity" />
        <activity android:name=".ui.FilterActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

M app/src/main/java/oppen/filters/FeatureFlags.kt => app/src/main/java/oppen/filters/FeatureFlags.kt +0 -2
@@ 1,8 1,6 @@
package oppen.filters

object FeatureFlags {
    val showUnlockFeatures = true

    fun isPlayStore(): Boolean = BuildConfig.IS_GOOGLE_PLAY
    fun isFreeVersion(): Boolean = BuildConfig.IS_FREE_VERSION
}
\ No newline at end of file

M app/src/main/java/oppen/filters/ui/FilterActivity.kt => app/src/main/java/oppen/filters/ui/FilterActivity.kt +5 -9
@@ 76,14 76,6 @@ class FilterActivity : AppCompatActivity(), FilterView {

        setContentView(R.layout.activity_main)

        if(FeatureFlags.isPlayStore() || !PreferenceManager.getDefaultSharedPreferences(this).getBoolean("show_donation_button", true)){
            kofi_button.hide()
        }

        kofi_button.setOnClickListener {
            KofiDialog(this).show()
        }

        //Set default preferences - has no effect if user has subsequently modified anything
        PreferenceManager.setDefaultValues(this, R.xml.app_preferences, false)



@@ 114,6 106,10 @@ class FilterActivity : AppCompatActivity(), FilterView {
            startActivityForResult(intent, CHOOSE_IMAGE_REQUEST)
        }

        kofi_button.setOnClickListener {
            KofiDialog(this).show()
        }

        overflow_button.setOnClickListener {
            OverflowMenu.show(this, overflow_button, floating_slider_layout, supportFragmentManager)
        }


@@ 166,7 162,7 @@ class FilterActivity : AppCompatActivity(), FilterView {
    override fun onResume() {
        super.onResume()

        if(PreferenceManager.getDefaultSharedPreferences(this).getBoolean("show_donation_button", true)){
        if(FeatureFlags.isFreeVersion() && PreferenceManager.getDefaultSharedPreferences(this).getBoolean("show_donation_button", true)){
            kofi_button.show()
        }else{
            kofi_button.hide()

R app/src/main/java/oppen/filters/ui/about/AboutBottomsheet.kt => app/src/main/java/oppen/filters/ui/about/AboutActivity.kt +12 -18
@@ 2,45 2,39 @@ package oppen.filters.ui.about

import android.content.Intent
import android.net.Uri
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import kotlinx.android.synthetic.main.bottomsheet_about.view.*
import kotlinx.android.synthetic.main.activity_about.*
import oppen.filters.R

class AboutBottomsheet: BottomSheetDialogFragment() {

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return inflater.inflate(R.layout.bottomsheet_about, container, false)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
class AboutActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_about)

        //OppenLab Header
        view.codeberg_button.setOnClickListener {
        codeberg_button.setOnClickListener {
            openBrowser("https://codeberg.org/oppen/Latt")
        }

        view.mastodon_button.setOnClickListener {
        mastodon_button.setOnClickListener {
            openBrowser("https://fosstodon.org/@oppen")
        }

        view.nounproject_button.setOnClickListener {
        nounproject_button.setOnClickListener {
            openBrowser("https://thenounproject.com/")
        }

        view.raw_therapee_button.setOnClickListener {
        raw_therapee_button.setOnClickListener {
            openBrowser("https://rawpedia.rawtherapee.com/Film_Simulation")
        }

        //OppenLab License/footer
        view.gnu_license_button.setOnClickListener {
        gnu_license_button.setOnClickListener {
            openBrowser("https://www.gnu.org/licenses/gpl-3.0.html")
        }

        view.oppenlab_button.setOnClickListener {
        oppenlab_button.setOnClickListener {
            openBrowser("https://oppenlab.net")
        }
    }

M app/src/main/java/oppen/filters/ui/views/OverflowMenu.kt => app/src/main/java/oppen/filters/ui/views/OverflowMenu.kt +2 -2
@@ 8,7 8,7 @@ import androidx.core.view.isVisible
import androidx.fragment.app.FragmentManager
import oppen.filters.R
import oppen.filters.fadeOut
import oppen.filters.ui.about.AboutBottomsheet
import oppen.filters.ui.about.AboutActivity
import oppen.filters.ui.preferences.PreferencesActivity

object OverflowMenu {


@@ 26,7 26,7 @@ object OverflowMenu {
                    if(window.isVisible) window.fadeOut(250L)
                    context.startActivity(Intent(context, PreferencesActivity::class.java))
                }
                R.id.about -> AboutBottomsheet().show(supportFragmentManager, "tag_about_dialog")
                R.id.about -> context.startActivity(Intent(context, AboutActivity::class.java))
            }

            true

R app/src/main/res/layout/bottomsheet_about.xml => app/src/main/res/layout/activity_about.xml +8 -0
@@ 1,6 1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">


@@ 39,6 40,13 @@
            android:paddingTop="@dimen/def_padding"
            android:text="@string/about_body"/>

        <TextView
            android:id="@+id/version_label"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingTop="@dimen/def_padding"
            tools:text="1.0.0 alpha delta"/>

        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"

M app/src/main/res/layout/activity_main.xml => app/src/main/res/layout/activity_main.xml +1 -2
@@ 38,8 38,7 @@
            android:shadowDx="1"
            android:shadowDy="1"
            android:shadowRadius="2"
            android:textSize="16sp"
            android:text="Lätt"/>
            android:textSize="16sp" />

        <androidx.appcompat.widget.AppCompatImageButton
            android:id="@+id/overflow_button"