Skip to content

Commit 0ae7364

Browse files
author
Patrick Jackson
committed
fix rotation bug on android
1 parent a91c59e commit 0ae7364

File tree

9 files changed

+11
-192
lines changed

9 files changed

+11
-192
lines changed

android/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ android {
1515
sourceCompatibility JavaVersion.VERSION_1_8
1616
targetCompatibility JavaVersion.VERSION_1_8
1717
}
18-
compileSdkVersion 28
18+
compileSdkVersion 29
1919
defaultConfig {
2020
applicationId "com.jackson.openlibrary"
2121
minSdkVersion 26
22-
targetSdkVersion 28
22+
targetSdkVersion 29
2323
versionCode 1
2424
versionName "1.0"
2525
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -71,7 +71,6 @@ dependencies {
7171
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"
7272
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion"
7373
implementation project(':common')
74-
implementation 'nl.dionsegijn:konfetti:1.1.2'
7574
implementation "com.russhwolf:multiplatform-settings:$multiplatformSettingsVersion"
7675
implementation "com.squareup.sqldelight:android-driver:$sqldelightVersion"
7776
implementation "org.reduxkotlin:redux-kotlin:0.2.2"

android/src/main/java/com/jackson/openlibrary/MainActivity.kt

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,11 @@ import android.os.Bundle
44
import android.os.Handler
55
import android.view.*
66
import androidx.appcompat.app.AppCompatActivity
7-
import androidx.fragment.app.Fragment
87
import com.bumptech.glide.annotation.GlideModule
98
import com.bumptech.glide.module.AppGlideModule
10-
import com.jackson.openlibrary.store.CompletedFragment
11-
import com.jackson.openlibrary.store.SearchFragment
12-
import com.jackson.openlibrary.store.ReadingListFragment
139
import com.willowtreeapps.common.UiActions
1410
import com.willowtreeapps.hyperion.core.Hyperion
1511
import kotlinx.android.synthetic.main.activity_main.*
16-
import java.lang.IllegalArgumentException
1712

1813

1914
@GlideModule
@@ -29,24 +24,10 @@ class MainActivity : AppCompatActivity() {
2924
super.onCreate(savedInstanceState)
3025
setContentView(R.layout.activity_main)
3126
setSupportActionBar(bottom_app_bar)
32-
val fragment = supportFragmentManager.findFragmentByTag(ReadingListFragment::class.java.name)
33-
?: ReadingListFragment()
34-
val fragTransaction = supportFragmentManager.beginTransaction()
35-
fragTransaction.replace(R.id.nav_host_fragment, fragment, fragment::class.java.name)
36-
fragTransaction.commit()
3727
fab.setOnClickListener {
3828
OpenLibraryApp.dispatch(UiActions.SearchBtnTapped())
3929
fab.hide()
4030
}
41-
42-
// btmNavigation.setOnNavigationItemSelectedListener(::handleBtmNavTap)
43-
// btmNavigation.selectedItemId = R.id.toRead
44-
}
45-
46-
override fun onCreateOptionsMenu(menu: Menu): Boolean {
47-
super.onCreateOptionsMenu(menu)
48-
// menuInflater.inflate(R.menu.btm_app_bar_menu, menu)
49-
return true
5031
}
5132

5233
override fun onOptionsItemSelected(item: MenuItem?): Boolean {

android/src/main/res/anim/layout_animation_fade_in.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

android/src/main/res/anim/slide_in_right.xml

Lines changed: 0 additions & 26 deletions
This file was deleted.

android/src/main/res/anim/slide_out_left.xml

Lines changed: 0 additions & 26 deletions
This file was deleted.

android/src/main/res/layout/activity_details.xml

Lines changed: 0 additions & 15 deletions
This file was deleted.

android/src/main/res/layout/activity_main.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,23 @@
77
android:layout_width="match_parent"
88
android:layout_height="match_parent">
99

10+
<FrameLayout
11+
android:layout_width="match_parent"
12+
android:layout_height="match_parent"
13+
app:layout_constraintBottom_toTopOf="@id/btmNavigation"
14+
app:layout_constraintTop_toTopOf="parent"
15+
>
1016
<fragment
1117
android:id="@+id/nav_host_fragment"
1218
android:name="androidx.navigation.fragment.NavHostFragment"
1319
android:layout_width="match_parent"
1420
android:layout_height="match_parent"
15-
app:layout_constraintBottom_toTopOf="@id/btmNavigation"
16-
app:layout_constraintTop_toTopOf="parent"
1721
app:navGraph="@navigation/nav_graph"
1822
app:defaultNavHost="true" />
1923

24+
</FrameLayout>
25+
26+
2027
<com.google.android.material.bottomappbar.BottomAppBar
2128
android:id="@+id/bottom_app_bar"
2229
android:layout_width="match_parent"

android/src/main/res/layout/fragment_settings.xml

Lines changed: 0 additions & 86 deletions
This file was deleted.

android/src/main/res/layout/list_divider.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)