Skip to content

Commit 7556657

Browse files
committed
# 0.5.0
- Add Legacy back-stack support, via fragment-manager (only for activity) - Migrate code to Rx to enable background thread - Add sample activity with fragment-manager - General optimization of filtering options - Migrate to Java11 - Add Timber for logging
1 parent c26d3ab commit 7556657

23 files changed

+453
-30436
lines changed

Diff for: CHANGELOG.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
# 0.5.0
2+
- Add Legacy back-stack support, via fragment-manager (only for activity)
3+
- Migrate code to Rx to enable background thread
4+
- Add sample activity with fragment-manager
5+
- General optimization of filtering options
6+
- Migrate to Java11
7+
- Add Timber for logging
8+
19
# 0.4.1
210
- Add filtering for event logs
3-
- Add filtering menu for object strcuture (wip)
11+
- Add filtering menu for object structure (wip)
412

513
# 0.4.0
614
- Add log side windows with events of Activities and Fragments

Diff for: CONTRIBUTE.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,25 @@ https://fbflipper.com/docs/extending/loading-custom-plugins
2424
## Start flipper from source
2525

2626
```shell script
27+
git fetch
2728
git pull
28-
yarn
29+
cd desktop
2930
yarn start
3031
```
3132

33+
In case of issue : brew reinstall icu4c
34+
yarn install
35+
3236

3337
## Update version on JitPack
3438

3539
- Update version number on build.gradle
3640
- Git commit, push
3741

38-
- Delete binary and lock file in destkop plugin
42+
## Update version on Npm
43+
44+
- Update version number on package.json
45+
- Delete binary and lock file in desktop plugin
3946
- npm install --force
4047
- (npm pack)
4148
- Git commit, push

Diff for: app/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ android {
2222
}
2323
}
2424
compileOptions {
25-
sourceCompatibility JavaVersion.VERSION_1_8
26-
targetCompatibility JavaVersion.VERSION_1_8
25+
sourceCompatibility JavaVersion.VERSION_11
26+
targetCompatibility JavaVersion.VERSION_11
2727
}
2828
kotlinOptions {
29-
jvmTarget = '1.8'
29+
jvmTarget = JavaVersion.VERSION_11.toString()
3030
}
3131
}
3232

Diff for: app/src/main/AndroidManifest.xml

+9
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@
1616
<activity
1717
android:name=".MainActivity"
1818
android:label="@string/title_activity_main">
19+
<!-- <intent-filter>-->
20+
<!-- <action android:name="android.intent.action.MAIN" />-->
21+
22+
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
23+
<!-- </intent-filter>-->
24+
25+
</activity>
26+
27+
<activity android:name=".OldSchoolActivity">
1928
<intent-filter>
2029
<action android:name="android.intent.action.MAIN" />
2130

Diff for: app/src/main/java/fr/afaucogney/mobile/android/flipper/flipperandroidbackstack/App.kt

+2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ import com.facebook.flipper.plugins.inspector.DescriptorMapping
77
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin
88
import com.facebook.soloader.SoLoader
99
import fr.afaucogney.mobile.flipper.BackStackFlipperPlugin
10+
import fr.afaucogney.mobile.flipper.internal.util.rx.HyperlinkedDebugTree
1011

1112
class App : Application() {
1213
override fun onCreate() {
1314
super.onCreate()
15+
1416
// if (BuildConfig.DEBUG) {
1517
SoLoader.init(this, false)
1618
// if (FlipperUtils.shouldEnableFlipper(this)) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package fr.afaucogney.mobile.android.flipper.flipperandroidbackstack
2+
3+
import android.os.Bundle
4+
import android.view.ContextMenu
5+
import android.view.MenuItem
6+
import android.view.View
7+
import androidx.appcompat.app.AppCompatActivity
8+
import com.google.android.material.bottomnavigation.BottomNavigationView
9+
import fr.afaucogney.mobile.android.flipper.flipperandroidbackstack.ui.dashboard.DashboardFragment
10+
import fr.afaucogney.mobile.android.flipper.flipperandroidbackstack.ui.home.HomeFragment
11+
import fr.afaucogney.mobile.android.flipper.flipperandroidbackstack.ui.notifications.NotificationsFragment
12+
13+
class OldSchoolActivity : AppCompatActivity() {
14+
15+
override fun onCreate(savedInstanceState: Bundle?) {
16+
super.onCreate(savedInstanceState)
17+
setContentView(R.layout.activity_old)
18+
// registerForContextMenu(findViewById(R.id.nav_view))
19+
supportFragmentManager
20+
.beginTransaction()
21+
.replace(R.id.nav_host_fragment, HomeFragment())
22+
.addToBackStack(null)
23+
.commit()
24+
25+
findViewById<BottomNavigationView>(R.id.nav_view).setOnNavigationItemSelectedListener { item->
26+
when (item.itemId) {
27+
R.id.navigation_home -> {
28+
supportFragmentManager
29+
.beginTransaction()
30+
.replace(R.id.nav_host_fragment, HomeFragment())
31+
.addToBackStack("1")
32+
.commit()
33+
true
34+
}
35+
R.id.navigation_dashboard -> {
36+
supportFragmentManager
37+
.beginTransaction()
38+
.replace(R.id.nav_host_fragment, DashboardFragment())
39+
.addToBackStack("2")
40+
.commit()
41+
true
42+
}
43+
else -> {
44+
supportFragmentManager
45+
.beginTransaction()
46+
.replace(R.id.nav_host_fragment, NotificationsFragment())
47+
.addToBackStack("3")
48+
.commit()
49+
true
50+
}
51+
}
52+
}
53+
}
54+
}

Diff for: app/src/main/res/layout/activity_old.xml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
android:id="@+id/container"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
android:paddingTop="?attr/actionBarSize">
8+
9+
<com.google.android.material.bottomnavigation.BottomNavigationView
10+
android:id="@+id/nav_view"
11+
android:layout_width="0dp"
12+
android:layout_height="wrap_content"
13+
android:layout_marginStart="0dp"
14+
android:layout_marginEnd="0dp"
15+
android:background="?android:attr/windowBackground"
16+
app:layout_constraintBottom_toBottomOf="parent"
17+
app:layout_constraintLeft_toLeftOf="parent"
18+
app:layout_constraintRight_toRightOf="parent"
19+
app:menu="@menu/bottom_nav_menu" />
20+
21+
<androidx.fragment.app.FragmentContainerView
22+
android:id="@+id/nav_host_fragment"
23+
android:layout_width="match_parent"
24+
android:layout_height="match_parent"
25+
app:layout_constraintBottom_toTopOf="@id/nav_view"
26+
app:layout_constraintLeft_toLeftOf="parent"
27+
app:layout_constraintRight_toRightOf="parent"
28+
app:layout_constraintTop_toTopOf="parent" />
29+
30+
</androidx.constraintlayout.widget.ConstraintLayout>

Diff for: flipper-backstack/build.gradle

+17-9
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77

88
android {
99
compileSdkVersion 30
10-
buildToolsVersion "30.0.3"
10+
buildToolsVersion "31.0.0"
1111

1212
defaultConfig {
1313
minSdkVersion 21
@@ -25,27 +25,35 @@ android {
2525
}
2626
}
2727
compileOptions {
28-
sourceCompatibility JavaVersion.VERSION_1_8
29-
targetCompatibility JavaVersion.VERSION_1_8
28+
sourceCompatibility JavaVersion.VERSION_11
29+
targetCompatibility JavaVersion.VERSION_11
3030
}
3131
kotlinOptions {
32-
jvmTarget = '1.8'
32+
jvmTarget = JavaVersion.VERSION_11.toString()
3333
}
3434
}
3535

3636
dependencies {
3737

38-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
38+
// Kotlin
3939

4040
// Flipper
4141
implementation deps.flipper_core
4242
implementation deps.flipper_soloader
4343
implementation deps.flipper_reflect
4444

45-
implementation 'androidx.core:core-ktx:1.3.2'
46-
implementation 'androidx.appcompat:appcompat:1.2.0'
47-
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.3'
48-
implementation 'androidx.navigation:navigation-ui-ktx:2.3.3'
45+
// Android
46+
implementation 'androidx.core:core-ktx:1.6.0'
47+
implementation 'androidx.appcompat:appcompat:1.3.1'
48+
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
49+
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
50+
51+
// Rx
52+
implementation "io.reactivex.rxjava3:rxjava:3.0.12"
53+
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
54+
implementation "io.reactivex.rxjava3:rxkotlin:3.0.1"
55+
56+
implementation "com.jakewharton.timber:timber:4.7.1"
4957

5058
// Test
5159
testImplementation deps.junit4

0 commit comments

Comments
 (0)