Skip to content

Commit

Permalink
Merge pull request #31 from emreesen27/start-and-button
Browse files Browse the repository at this point in the history
Start and button
  • Loading branch information
emreesen27 authored Feb 13, 2024
2 parents 0e4c0b4 + 4b3f453 commit d178e8d
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/sn/snfilemanager/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import android.os.Bundle
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.findNavController
import com.sn.snfilemanager.core.Config
import com.sn.snfilemanager.core.extensions.observe
import com.sn.snfilemanager.core.util.Config
import com.sn.snfilemanager.databinding.ActivityMainBinding
import com.sn.snfilemanager.feature.settings.SettingsUtils
import dagger.hilt.android.AndroidEntryPoint
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sn.snfilemanager.core
package com.sn.snfilemanager.core.util

object Config {
var hiddenFile: Boolean = false
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/java/com/sn/snfilemanager/core/util/Constant.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.sn.snfilemanager.core.util

object Constant {
const val GITHUB_URL =
"https://github.com/emreesen27/Android-Sn-File-Manager"
const val PRIVACY_URL =
"https://github.com/emreesen27/Android-Sn-File-Manager/blob/develop/PRIVACY.md"
const val OPEN_SOURCE_LICENSE =
"https://github.com/emreesen27/Android-Sn-File-Manager/blob/develop/LICENSE"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import androidx.navigation.fragment.findNavController
import com.sn.snfilemanager.core.base.BaseFragment
import com.sn.snfilemanager.core.extensions.click
import com.sn.snfilemanager.core.extensions.startActivitySafely
import com.sn.snfilemanager.core.util.Constant.GITHUB_URL
import com.sn.snfilemanager.core.util.Constant.PRIVACY_URL
import com.sn.snfilemanager.databinding.FragmentAboutBinding
import com.sn.snfilemanager.view.dialog.license.LicenseDialog

Expand All @@ -14,13 +16,6 @@ class AboutFragment : BaseFragment<FragmentAboutBinding, AboutViewModel>() {

override fun getViewBinding() = FragmentAboutBinding.inflate(layoutInflater)

companion object {
const val GITHUB_URL =
"https://github.com/emreesen27/Android-Sn-File-Manager"
const val PRIVACY_URL =
"https://github.com/emreesen27/Android-Sn-File-Manager/blob/develop/PRIVACY.md"
}

override fun setupViews() {
binding.vm = viewModel
binding.lifecycleOwner = viewLifecycleOwner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.sn.mediastorepv.data.ConflictStrategy
import com.sn.mediastorepv.data.MediaType
import com.sn.snfilemanager.core.Config
import com.sn.snfilemanager.core.base.BaseResult
import com.sn.snfilemanager.core.util.Config
import com.sn.snfilemanager.core.util.Event
import com.sn.snfilemanager.core.util.RootPath
import com.sn.snfilemanager.feature.files.data.FileModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import androidx.preference.ListPreference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreferenceCompat
import com.sn.snfilemanager.R
import com.sn.snfilemanager.core.Config
import com.sn.snfilemanager.core.util.Config

class SettingsFragment : PreferenceFragmentCompat() {
private lateinit var mListenerOptions: OnSharedPreferenceChangeListener
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
package com.sn.snfilemanager.feature.start

import android.content.Intent
import android.net.Uri
import com.sn.snfilemanager.BuildConfig
import com.sn.snfilemanager.core.base.BaseFragment
import com.sn.snfilemanager.core.extensions.click
import com.sn.snfilemanager.core.extensions.startActivitySafely
import com.sn.snfilemanager.core.util.Constant.OPEN_SOURCE_LICENSE
import com.sn.snfilemanager.core.util.Constant.PRIVACY_URL
import com.sn.snfilemanager.databinding.FragmentStartBinding
import dagger.hilt.android.AndroidEntryPoint

Expand All @@ -29,9 +34,13 @@ class StartFragment : BaseFragment<FragmentStartBinding, StartViewModel>() {
}
}

// Todo click implementation
private fun clicksPolicy() {
binding.mtvPrivacyPolicy.click { }
binding.mtvOpenSourcePolicy.click { }
binding.mtvPrivacyPolicy.click { openUrl(PRIVACY_URL) }
binding.mtvOpenSourcePolicy.click { openUrl(OPEN_SOURCE_LICENSE) }
}

private fun openUrl(url: String) {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
context?.startActivitySafely(intent)
}
}
2 changes: 2 additions & 0 deletions app/src/main/res/layout/dialog_permission.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
android:fontFamily="@font/adamina"
android:padding="10dp"
android:text="@string/click_to_allow"
android:textAllCaps="false"
android:textColor="@color/white"
android:textSize="@dimen/_12ssp"
app:layout_constraintBottom_toBottomOf="@+id/container"
app:layout_constraintEnd_toEndOf="@+id/container"
app:layout_constraintStart_toStartOf="@+id/container" />
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/layout/fragment_permission.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
android:backgroundTint="@color/main_color"
android:fontFamily="@font/adamina"
android:padding="10dp"
android:textAllCaps="false"
android:textSize="@dimen/_12ssp"
android:text="@string/continue_key"
android:textColor="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/layout/fragment_start.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@
android:fontFamily="@font/adamina"
android:padding="10dp"
android:text="@string/continue_key"
android:textAllCaps="false"
android:textColor="@color/white"
android:textSize="@dimen/_12ssp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
Expand Down

0 comments on commit d178e8d

Please sign in to comment.