forked from wulkanowy/wulkanowy
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
355 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+0 Bytes
(100%)
app/fdroid/release/baselineProfiles/0/app-fdroid-release.dm
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
app/src/main/java/io/github/freewulkanowy/ui/modules/onboarding/Onboarding1Fragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package io.github.freewulkanowy.ui.modules.onboarding | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import io.github.freewulkanowy.R | ||
import io.github.freewulkanowy.databinding.FragmentOnboarding1Binding | ||
import io.github.freewulkanowy.ui.base.BaseFragment | ||
|
||
class Onboarding1Fragment : BaseFragment<FragmentOnboarding1Binding>(R.layout.fragment_onboarding_1), | ||
OnboardingView { | ||
|
||
companion object { | ||
fun newInstance() = Onboarding1Fragment() | ||
} | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
return inflater.inflate(R.layout.fragment_onboarding_1, container, false) | ||
} | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
binding = FragmentOnboarding1Binding.bind(view) | ||
|
||
binding.onboardingNextBtn.setOnClickListener { | ||
val newFragment = Onboarding2Fragment() | ||
val transaction = parentFragmentManager.beginTransaction() | ||
transaction.replace(R.id.onboardingContainer, newFragment) | ||
transaction.commit() | ||
} | ||
} | ||
|
||
override fun initView() { | ||
(requireActivity() as OnboardingActivity) | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
app/src/main/java/io/github/freewulkanowy/ui/modules/onboarding/Onboarding2Fragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package io.github.freewulkanowy.ui.modules.onboarding | ||
|
||
import android.content.Intent | ||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.preference.PreferenceManager | ||
import io.github.freewulkanowy.R | ||
import io.github.freewulkanowy.databinding.FragmentOnboarding2Binding | ||
import io.github.freewulkanowy.ui.base.BaseFragment | ||
import io.github.freewulkanowy.ui.modules.main.MainActivity | ||
|
||
class Onboarding2Fragment : BaseFragment<FragmentOnboarding2Binding>(R.layout.fragment_onboarding_2), | ||
OnboardingView { | ||
|
||
companion object { | ||
fun newInstance() = Onboarding2Fragment() | ||
} | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
return inflater.inflate(R.layout.fragment_onboarding_2, container, false) | ||
} | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
binding = FragmentOnboarding2Binding.bind(view) | ||
|
||
binding.onboardingCloseBtn.setOnClickListener { | ||
val prefs = PreferenceManager.getDefaultSharedPreferences(requireContext()) | ||
prefs.edit().putBoolean("completedOnboarding", true).apply() | ||
startActivity(Intent(requireContext(), MainActivity::class.java)) | ||
requireActivity().finish() | ||
} | ||
} | ||
|
||
override fun initView() { | ||
(requireActivity() as OnboardingActivity) | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
app/src/main/java/io/github/freewulkanowy/ui/modules/onboarding/OnboardingActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package io.github.freewulkanowy.ui.modules.onboarding | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import androidx.fragment.app.FragmentManager.POP_BACK_STACK_INCLUSIVE | ||
import androidx.fragment.app.commit | ||
import dagger.hilt.android.AndroidEntryPoint | ||
import io.github.freewulkanowy.R | ||
import io.github.freewulkanowy.databinding.ActivityOnboardingBinding | ||
import io.github.freewulkanowy.ui.base.BaseActivity | ||
import io.github.freewulkanowy.utils.AppInfo | ||
import io.github.freewulkanowy.utils.InAppUpdateHelper | ||
import javax.inject.Inject | ||
|
||
@AndroidEntryPoint | ||
class OnboardingActivity : BaseActivity<OnboardingPresenter, ActivityOnboardingBinding>(), OnboardingView { | ||
|
||
@Inject | ||
override lateinit var presenter: OnboardingPresenter | ||
|
||
@Inject | ||
lateinit var inAppUpdateHelper: InAppUpdateHelper | ||
|
||
@Inject | ||
lateinit var appInfo: AppInfo | ||
|
||
companion object { | ||
fun getStartIntent(context: Context) = Intent(context, OnboardingActivity::class.java) | ||
} | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(ActivityOnboardingBinding.inflate(layoutInflater).apply { binding = this }.root) | ||
|
||
presenter.onAttachView(this) | ||
inAppUpdateHelper.checkAndInstallUpdates() | ||
|
||
if (savedInstanceState == null) { | ||
openFragment(Onboarding1Fragment.newInstance(), clearBackStack = true) | ||
} | ||
} | ||
|
||
override fun initView() {} | ||
|
||
private fun openFragment(fragment: Fragment, clearBackStack: Boolean = false) { | ||
supportFragmentManager.popBackStack(fragment::class.java.name, POP_BACK_STACK_INCLUSIVE) | ||
|
||
supportFragmentManager.commit { | ||
replace(R.id.onboardingContainer, fragment) | ||
setReorderingAllowed(true) | ||
if (!clearBackStack) addToBackStack(fragment::class.java.name) | ||
} | ||
} | ||
|
||
override fun onResume() { | ||
super.onResume() | ||
inAppUpdateHelper.onResume() | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
app/src/main/java/io/github/freewulkanowy/ui/modules/onboarding/OnboardingPresenter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.github.freewulkanowy.ui.modules.onboarding | ||
|
||
import io.github.freewulkanowy.data.repositories.StudentRepository | ||
import io.github.freewulkanowy.ui.base.BasePresenter | ||
import io.github.freewulkanowy.ui.base.ErrorHandler | ||
import timber.log.Timber | ||
import javax.inject.Inject | ||
|
||
class OnboardingPresenter @Inject constructor( | ||
errorHandler: ErrorHandler, | ||
studentRepository: StudentRepository, | ||
) : BasePresenter<OnboardingView>(errorHandler, studentRepository) { | ||
|
||
override fun onAttachView(view: OnboardingView) { | ||
super.onAttachView(view) | ||
view.initView() | ||
Timber.i("Onboarding view was initialized") | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
app/src/main/java/io/github/freewulkanowy/ui/modules/onboarding/OnboardingView.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package io.github.freewulkanowy.ui.modules.onboarding | ||
|
||
import io.github.freewulkanowy.ui.base.BaseView | ||
|
||
interface OnboardingView : BaseView { | ||
|
||
fun initView() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<androidx.fragment.app.FragmentContainerView | ||
android:id="@+id/onboardingContainer" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:layout_weight="1" | ||
tools:layout="@layout/fragment_onboarding_1" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ScrollView 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:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:fillViewport="true"> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<ImageView | ||
android:id="@+id/onboardingIcon" | ||
android:layout_width="96dp" | ||
android:layout_height="96dp" | ||
android:layout_marginTop="32dp" | ||
android:src="@mipmap/ic_launcher" | ||
app:layout_constraintBottom_toTopOf="@id/onboarding1Text" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintVertical_chainStyle="packed" | ||
app:srcCompat="@drawable/ic_launcher_foreground_mono" /> | ||
|
||
<TextView | ||
android:id="@+id/onboarding1Text" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginHorizontal="32dp" | ||
android:layout_marginTop="16dp" | ||
android:fontFamily="sans-serif-medium" | ||
android:gravity="center" | ||
android:text="@string/onboarding_1_title" | ||
android:textSize="28sp" | ||
app:layout_constraintBottom_toTopOf="@id/onboarding1Description" | ||
app:layout_constraintTop_toBottomOf="@id/onboardingIcon" /> | ||
|
||
<TextView | ||
android:id="@+id/onboarding1Description" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginHorizontal="32dp" | ||
android:layout_marginTop="16dp" | ||
android:gravity="center" | ||
android:textSize="16sp" | ||
app:layout_constraintBottom_toTopOf="@id/onboardingNextBtn" | ||
app:layout_constraintTop_toBottomOf="@id/onboarding1Text" | ||
tools:maxLines="15" | ||
android:text="@string/onboarding_1_message" /> | ||
|
||
<com.google.android.material.button.MaterialButton | ||
android:id="@+id/onboardingNextBtn" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="48dp" | ||
android:layout_marginBottom="32dp" | ||
android:layout_marginLeft="32dp" | ||
android:layout_marginRight="32dp" | ||
android:textSize="16sp" | ||
android:text="@string/onboarding_next_btn" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
tools:ignore="MissingConstraints" /> | ||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</ScrollView> |
Oops, something went wrong.