Skip to content

Commit

Permalink
Bump version to 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alialbaali committed Feb 9, 2022
1 parent dca1801 commit 317e099
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 47 deletions.
10 changes: 8 additions & 2 deletions app/src/main/java/com/noto/app/domain/model/Release.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ sealed interface Release {
data class Version(val major: Int, val minor: Int, val patch: Int) {

companion object {
const val Current = "1.8.0"
const val Last = "1.7.2"
const val Current = "2.0.0"
const val Last = "1.8.0"
}

override fun toString(): String = "$major.$minor.$patch"
Expand All @@ -28,4 +28,10 @@ sealed interface Release {
data class Release_1_8_0(override val changelog: Changelog) : Release {
override val version: Version = Version(1, 8, 0)
override val date: LocalDate = LocalDate(2022, Month.JANUARY, 11)
}

@Suppress("ClassName")
data class Release_2_0_0(override val changelog: Changelog) : Release {
override val version: Version = Version(2, 0, 0)
override val date: LocalDate = LocalDate(2022, Month.FEBRUARY, 9)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager
import com.google.android.material.tabs.TabLayout
import com.noto.app.BaseDialogFragment
import com.noto.app.R
Expand All @@ -14,6 +15,7 @@ import com.noto.app.databinding.WhatsNewDialogFragmentBinding
import com.noto.app.domain.model.Release
import com.noto.app.domain.model.Release.Changelog
import com.noto.app.domain.model.Release_1_8_0
import com.noto.app.domain.model.Release_2_0_0
import com.noto.app.util.BounceEdgeEffectFactory
import com.noto.app.util.VerticalListItemAnimator
import com.noto.app.util.stringResource
Expand All @@ -37,8 +39,8 @@ class WhatsNewDialogFragment : BaseDialogFragment() {

private val currentRelease: List<Release> by lazy {
context?.let { context ->
val changelog = Changelog(context.stringResource(R.string.release_1_8_0))
listOf(Release_1_8_0(changelog))
val changelog = Changelog(context.stringResource(R.string.release_2_0_0))
listOf(Release_2_0_0(changelog))
} ?: emptyList()
}

Expand Down Expand Up @@ -68,6 +70,8 @@ class WhatsNewDialogFragment : BaseDialogFragment() {
private fun WhatsNewDialogFragmentBinding.setupState() {
rv.edgeEffectFactory = BounceEdgeEffectFactory()
rv.itemAnimator = VerticalListItemAnimator()
rv.layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)

viewModel.whatsNewTab
.mapNotNull { tab ->
when (tab) {
Expand Down
74 changes: 33 additions & 41 deletions app/src/main/res/layout/whats_new_dialog_fragment.xml
Original file line number Diff line number Diff line change
@@ -1,56 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
style="@style/BaseDialogFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
android:id="@+id/abl"
android:elevation="@dimen/elevation_small"
android:orientation="vertical"
android:background="@drawable/dialog_shape"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_height="wrap_content">

<LinearLayout
android:id="@+id/abl"
android:elevation="@dimen/elevation_small"
android:orientation="vertical"
android:background="@drawable/dialog_shape"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<include layout="@layout/base_dialog_fragment" />

<com.google.android.material.tabs.TabLayout
android:id="@+id/tl_whats_new"
style="@style/TabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_normal">

<com.google.android.material.tabs.TabItem
android:text="@string/current_release"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<include layout="@layout/base_dialog_fragment" />

<com.google.android.material.tabs.TabItem
android:text="@string/previous_releases"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</com.google.android.material.tabs.TabLayout>
</LinearLayout>

<com.airbnb.epoxy.EpoxyRecyclerView
android:id="@+id/rv"
<com.google.android.material.tabs.TabLayout
android:id="@+id/tl_whats_new"
style="@style/TabLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false"
android:paddingTop="@dimen/spacing_small"
android:paddingHorizontal="@dimen/spacing_small"
android:paddingBottom="@dimen/padding_bottom"
tools:listitem="@layout/release_item" />
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_normal">

<com.google.android.material.tabs.TabItem
android:text="@string/current_release"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<com.google.android.material.tabs.TabItem
android:text="@string/previous_releases"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</com.google.android.material.tabs.TabLayout>
</LinearLayout>

<com.airbnb.epoxy.EpoxyRecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="500dp"
android:clipChildren="false"
android:clipToPadding="false"
android:padding="@dimen/spacing_small"
tools:listitem="@layout/release_item" />

<com.google.android.material.button.MaterialButton
android:id="@+id/btn_okay"
style="@style/MaterialButton"
Expand All @@ -61,4 +53,4 @@
android:paddingVertical="@dimen/spacing_normal"
android:text="@string/okay" />

</FrameLayout>
</LinearLayout>
4 changes: 2 additions & 2 deletions buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ object Versions {
}

object App {
const val VersionName = "1.8.0"
const val VersionCode = 33
const val VersionName = "2.0.0"
const val VersionCode = 34
const val ID = "com.noto"
const val MinSDK = 21
const val CompileSDK = 31
Expand Down

0 comments on commit 317e099

Please sign in to comment.