Skip to content

Commit 59e135e

Browse files
committed
Fix being able to show Renter from setting launch option. Wallet FAB changes back as soon as collapse begins. v0.1.10
1 parent 9c2296b commit 59e135e

File tree

5 files changed

+13
-17
lines changed

5 files changed

+13
-17
lines changed

app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ android {
1414
applicationId "com.vandyke.sia"
1515
minSdkVersion 21
1616
targetSdkVersion 27
17-
versionCode 109
18-
versionName "0.1.9"
17+
versionCode 110
18+
versionName "0.1.10"
1919
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
2020
/* lets us not shrink debug builds, for faster build times. Not necessary for release builds, since we shrink those */
2121
multiDexEnabled true
@@ -39,7 +39,7 @@ android {
3939
}
4040
}
4141
splits {
42-
/* see main.c file in cpp directory for why we use ABI splits */
42+
/* see app/src/main/cpp/main.c for why we use ABI splits */
4343
abi {
4444
enable true
4545
reset()

app/src/main/java/com/vandyke/sia/ui/main/MainActivity.kt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ import com.vandyke.sia.data.siad.SiadService
2222
import com.vandyke.sia.ui.common.BaseFragment
2323
import com.vandyke.sia.ui.onboarding.IntroActivity
2424
import com.vandyke.sia.ui.onboarding.PurchaseActivity
25-
import com.vandyke.sia.ui.renter.files.view.FilesFragment
26-
import com.vandyke.sia.ui.terminal.TerminalFragment
27-
import com.vandyke.sia.ui.wallet.view.WalletFragment
2825
import com.vandyke.sia.util.GenUtil
2926
import com.vandyke.sia.util.observe
3027
import kotlinx.android.synthetic.main.activity_main.*
@@ -114,18 +111,18 @@ class MainActivity : AppCompatActivity() {
114111
/* notify VM when navigation items are selected */
115112
navigationView.setNavigationItemSelectedListener({ item ->
116113
drawerLayout.closeDrawers()
117-
viewModel.navigationItemSelected(item)
114+
viewModel.navigationItemSelected(item.itemId)
118115
return@setNavigationItemSelectedListener true
119116
})
120117
drawerToggle = ActionBarDrawerToggle(this, drawerLayout, R.string.drawer_open, R.string.drawer_close)
121118
drawerLayout.addDrawerListener(drawerToggle)
122119

123120
/* set the VM's visibleFragmentClass differently depending on whether the activity is being recreated */
124121
if (savedInstanceState == null) {
125-
viewModel.setDisplayedFragmentClass(when (Prefs.startupPage) {
126-
"renter" -> FilesFragment::class.java
127-
"wallet" -> WalletFragment::class.java
128-
"terminal" -> TerminalFragment::class.java
122+
viewModel.navigationItemSelected(when (Prefs.startupPage) {
123+
"renter" -> R.id.drawer_item_renter
124+
"wallet" -> R.id.drawer_item_wallet
125+
"terminal" -> R.id.drawer_item_terminal
129126
else -> throw Exception()
130127
})
131128
} else {

app/src/main/java/com/vandyke/sia/ui/main/MainViewModel.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package com.vandyke.sia.ui.main
66

77
import android.arch.lifecycle.MutableLiveData
88
import android.arch.lifecycle.ViewModel
9-
import android.view.MenuItem
109
import com.vandyke.sia.BuildConfig
1110
import com.vandyke.sia.R
1211
import com.vandyke.sia.ui.about.AboutFragment
@@ -21,8 +20,8 @@ class MainViewModel : ViewModel() {
2120
val title = MutableLiveData<String>()
2221
val selectedMenuItem = MutableLiveData<Int>()
2322

24-
fun navigationItemSelected(item: MenuItem) {
25-
visibleFragmentClass.value = when (item.itemId) {
23+
fun navigationItemSelected(itemId: Int) {
24+
visibleFragmentClass.value = when (itemId) {
2625
R.id.drawer_item_renter -> {
2726
if (BuildConfig.DEBUG)
2827
FilesFragment::class.java

app/src/main/java/com/vandyke/sia/ui/wallet/view/WalletFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,13 @@ class WalletFragment : BaseFragment() {
217217
}
218218

219219
fun collapseFrame() {
220+
expandedFragment = null
221+
setFabIcon()
220222
expandableFrame.collapseVertically({
221223
val currentChildFragment = childFragmentManager.findFragmentById(R.id.expandableFrame)
222224
if (currentChildFragment != null)
223225
childFragmentManager.beginTransaction().remove(currentChildFragment).commit()
224226
setProgressColor(android.R.color.white)
225-
expandedFragment = null
226-
setFabIcon()
227227
})
228228
GenUtil.hideSoftKeyboard(activity!!)
229229
}

app/src/main/res/layout/activity_purchase.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
android:layout_marginStart="32dp"
3030
android:layout_marginTop="16dp"
3131
android:gravity="center"
32-
android:text="Sia for Android is still in heavy development. By subscribing, you'll support development, and gain access to all features, including new ones as they're added. Starts with an automatic 30 day free trial. Cancellable at any time."
32+
android:text="Sia for Android is still in heavy development. By subscribing, you'll support development, and gain access to all features, including new ones as they're added. Starts with an automatic 30 day free trial. Easily cancellable at any time from Settings."
3333
android:textSize="18sp"
3434
app:layout_constraintBottom_toTopOf="@id/subscribe"
3535
app:layout_constraintEnd_toEndOf="parent"

0 commit comments

Comments
 (0)