Skip to content

Commit

Permalink
Merge pull request #75 from gatheringhallstudios/weaponui
Browse files Browse the repository at this point in the history
Added changelog button and updated version for release.
  • Loading branch information
jaysondc authored Dec 12, 2018
2 parents 3feed7d + 512cc0e commit d3cda58
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 35 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId "com.gatheringhallstudios.mhworlddatabase"
minSdkVersion 19
targetSdkVersion 28
versionCode 5
versionName "1.1.0"
versionCode 6
versionName "1.1.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ChangelogActivity">
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.gatheringhallstudios.mhworlddatabase

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.michaelflisar.changelog.ChangelogBuilder
import kotlinx.android.synthetic.main.fragment_changelog.*

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

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

ChangelogBuilder()
.withTitle(getString(R.string.title_changelog))
.withOkButtonLabel(getString(R.string.action_ok))
.withRateButton(true)
.withRateButtonLabel(getString(R.string.label_rate_app))
.buildAndSetup(changelog_recycler)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ import com.michaelflisar.changelog.classes.ChangelogFilter
import com.michaelflisar.changelog.classes.ImportanceChangelogSorter
import com.michaelflisar.changelog.ChangelogBuilder
import com.michaelflisar.changelog.classes.DefaultAutoVersionNameFormatter



import com.michaelflisar.changelog.internal.ChangelogPreferenceUtil


/**
Expand Down Expand Up @@ -64,13 +62,7 @@ class MainActivity : AppCompatActivity() {

setSupportActionBar(this.toolbar)
setupNavigation()

ChangelogBuilder()
.withManagedShowOnStart(true) // library will take care to show activity/dialog only if the changelog has new infos and will only show this new infos
.withMinVersionToShow(110)
.withTitle("New features and bug fixes!") // provide a custom title if desired, default one is "Changelog <VERSION>"
.withOkButtonLabel("Ok") // provide a custom ok button text if desired, default one is "OK"
.buildAndShowDialog(this, true) // second parameter defines, if the dialog has a dark or light theme
showChangelog()

viewModel.searchActive.observe(this, Observer {
val active = it ?: false
Expand Down Expand Up @@ -101,6 +93,21 @@ class MainActivity : AppCompatActivity() {
})
}

private fun showChangelog() {
ChangelogBuilder()
// library will take care to show activity/dialog only if the changelog has new
// info and will only show this new info
.withManagedShowOnStart(true)
// provide a custom title if desired, default one is "Changelog <VERSION>"
.withTitle(getString(R.string.label_whats_new))
// provide a custom ok button text if desired, default one is "OK"
.withOkButtonLabel(getString(R.string.action_ok))
.withRateButton(true)
.withRateButtonLabel(getString(R.string.label_rate_app))
// second parameter defines, if the dialog has a dark or light theme
.buildAndShowDialog(this, true)
}

/**
* Requests the search view to contain a new value directly.
* This will indirectly update the activity viewmodel's filter property.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import com.gatheringhallstudios.mhworlddatabase.R
import com.gatheringhallstudios.mhworlddatabase.R.id.*
import com.gatheringhallstudios.mhworlddatabase.assets.AssetLoader
import com.gatheringhallstudios.mhworlddatabase.assets.AssetLoader.loadIconFor
import com.gatheringhallstudios.mhworlddatabase.assets.AssetLoader.loadNoteFromChar
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/res/layout/fragment_changelog.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<!-- This is populated at runtime by the changelog library -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/changelog_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/margin_large"/>
</FrameLayout>
4 changes: 4 additions & 0 deletions app/src/main/res/menu/activity_main_drawer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
android:id="@+id/settingsAction"
android:icon="@drawable/ic_ui_settings_white"
android:title="@string/title_settings" />
<item
android:id="@+id/changelogAction"
android:icon="@xml/ic_items_voucher_base"
android:title="@string/title_changelog"/>
<item
android:id="@+id/aboutAction"
android:icon="@drawable/ic_ui_mascot"
Expand Down
31 changes: 21 additions & 10 deletions app/src/main/res/navigation/nav_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
app:popExitAnim="@anim/nav_default_pop_exit_anim"/>

<fragment
android:id="@+id/weaponTreeDestination"
android:name="com.gatheringhallstudios.mhworlddatabase.features.weapons.list.WeaponTreeListFragment"
tools:layout="@layout/list_generic" />
<action
android:id="@+id/openWeaponTreeAction"
app:destination="@id/weaponTreeDestination"
app:enterAnim="@anim/nav_enter_right"
app:exitAnim="@anim/nav_exit_left"
app:popEnterAnim="@anim/nav_enter_left"
app:popExitAnim="@anim/nav_exit_right" />

<fragment
android:id="@+id/armorListDestination"
android:name="com.gatheringhallstudios.mhworlddatabase.features.armor.list.ArmorSetListPagerFragment"
Expand Down Expand Up @@ -255,24 +267,23 @@
app:popExitAnim="@anim/nav_exit_right" />

<fragment
android:id="@+id/weaponTreeDestination"
android:name="com.gatheringhallstudios.mhworlddatabase.features.weapons.list.WeaponTreeListFragment"
tools:layout="@layout/list_generic" />
android:id="@+id/weaponDetailDestination"
android:name="com.gatheringhallstudios.mhworlddatabase.features.weapons.detail.WeaponDetailPagerFragment"
tools:layout="@layout/fragment_weapon_summary" />
<action
android:id="@+id/openWeaponTreeAction"
app:destination="@id/weaponTreeDestination"
android:id="@+id/openWeaponDetailAction"
app:destination="@id/weaponDetailDestination"
app:enterAnim="@anim/nav_enter_right"
app:exitAnim="@anim/nav_exit_left"
app:popEnterAnim="@anim/nav_enter_left"
app:popExitAnim="@anim/nav_exit_right" />

<fragment
android:id="@+id/weaponDetailDestination"
android:name="com.gatheringhallstudios.mhworlddatabase.features.weapons.detail.WeaponDetailPagerFragment"
tools:layout="@layout/fragment_weapon_summary" />
android:id="@+id/changelogDestination"
android:name="com.gatheringhallstudios.mhworlddatabase.ChangelogActivity"/>
<action
android:id="@+id/openWeaponDetailAction"
app:destination="@id/weaponDetailDestination"
android:id="@+id/changelogAction"
app:destination="@id/changelogDestination"
app:enterAnim="@anim/nav_enter_right"
app:exitAnim="@anim/nav_exit_left"
app:popEnterAnim="@anim/nav_enter_left"
Expand Down
26 changes: 13 additions & 13 deletions app/src/main/res/raw/changelog.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<changelog>
<release
versionCode="110"
versionName="Version 1.1.0">
versionCode="6"
versionName="Version 1.1.1">
<info>Features:
[br]&#9;- Weapons Section
[br]&#9;- TRANSLATIONS BETA! We're looking for translation help! Contact us on Discord
[br](link in About page). Supported Languages:
[br]&#9;- WEAPONS SECTION
[br]&#9;- TRANSLATIONS BETA! Supported Languages:
[br]&#9;&#9;- English
[br]&#9;&#9;- 日本語
[br]&#9;&#9;- Français
Expand All @@ -24,22 +23,23 @@
[br]&#9;- Monster Ailments
[br]&#9;- Deviljo Gear
</info>
<info>Thank you for your patience! 😺</info>
<info>[br]Thank you for your patience! 😺</info>
<info>[br]We're looking for help with UI translations! Contact us on Discord (link is in our "About" page).</info>
</release>
<release
versionCode="103"
versionCode="4"
versionName="Version 1.0.3">
<new>Added base camp locations.</new>
<bugfix>Fixed a bug causing monster ice hitzones to be 0.</bugfix>
<info>Added base camp locations.</info>
<info>Fixed a bug causing monster ice hitzones to be 0.</info>
</release>
<release
versionCode="101"
versionCode="3"
versionName="Version 1.0.1">
<bugfix>Fixed crashes occurring on some devices.</bugfix>
<info>&#9;- Fixed crashes occurring on some devices.</info>
</release>
<release
versionCode="100"
versionCode="2"
versionName="Version 1.0">
<info>Initial Release! MHWorld Database is finally here!</info>
<info>&#9;- Initial Release! MHWorld Database is finally here!</info>
</release>
</changelog>
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@

<string name="title_about">About</string>
<string name="title_settings">Settings</string>
<string name="title_changelog">Changelog</string>
<string name="label_whats_new">What\'s new!</string>
<string name="label_rate_app">RATE OUR APP!</string>
<string name="action_ok">OK</string>
<string name="preference_data_language">Data Language (BETA / INCOMPLETE)</string>
<string name="preference_data_language_description">
Show names and descriptions using %s.
Expand Down

0 comments on commit d3cda58

Please sign in to comment.