Compare commits
No commits in common. "40e1d1478b4db29577068734f8ae50d36befc037" and "90532cf501e5cf42e4d31a6e3ff128e839b323cf" have entirely different histories.
40e1d1478b
...
90532cf501
16
CHANGELOG.md
16
CHANGELOG.md
@ -1,19 +1,3 @@
|
|||||||
**v123010241**
|
|
||||||
|
|
||||||
- Merge pull request 'feat: swipe down to close images' (#122) from davidoskky/ReaderForSelfoss-multiplatform:swipe_down into master
|
|
||||||
- Remove unnecessary definition
|
|
||||||
- Remove unused import
|
|
||||||
- Adjust the image closing animation
|
|
||||||
- Add a dark hue to the underlying article when swiping to close images
|
|
||||||
- Rename activity style to avoid interferences
|
|
||||||
- Adapt the style of the image activity to the rest of the application
|
|
||||||
- Resolve issues when swiping down to close images
|
|
||||||
- Close the image fragment only if the image has been dragged down
|
|
||||||
- Animate swipe down to close images
|
|
||||||
- Swipe down to close images
|
|
||||||
|
|
||||||
--------------------------------------------------------------------
|
|
||||||
|
|
||||||
**v123010041**
|
**v123010041**
|
||||||
|
|
||||||
- Merge pull request 'scroll-tag-filters' (#124) from scroll-tag-filters into master
|
- Merge pull request 'scroll-tag-filters' (#124) from scroll-tag-filters into master
|
||||||
|
@ -115,6 +115,7 @@ dependencies {
|
|||||||
implementation(project(":shared"))
|
implementation(project(":shared"))
|
||||||
implementation("com.google.android.material:material:1.5.0")
|
implementation("com.google.android.material:material:1.5.0")
|
||||||
implementation("androidx.appcompat:appcompat:1.4.1")
|
implementation("androidx.appcompat:appcompat:1.4.1")
|
||||||
|
implementation("androidx.constraintlayout:constraintlayout:2.1.3")
|
||||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0")
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0")
|
||||||
|
|
||||||
implementation("androidx.preference:preference-ktx:1.1.1")
|
implementation("androidx.preference:preference-ktx:1.1.1")
|
||||||
@ -130,7 +131,7 @@ dependencies {
|
|||||||
implementation("androidx.cardview:cardview:1.0.0")
|
implementation("androidx.cardview:cardview:1.0.0")
|
||||||
implementation("androidx.annotation:annotation:1.3.0")
|
implementation("androidx.annotation:annotation:1.3.0")
|
||||||
implementation("androidx.work:work-runtime-ktx:2.7.1")
|
implementation("androidx.work:work-runtime-ktx:2.7.1")
|
||||||
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
implementation("androidx.constraintlayout:constraintlayout:2.1.3")
|
||||||
implementation("org.jsoup:jsoup:1.14.3")
|
implementation("org.jsoup:jsoup:1.14.3")
|
||||||
|
|
||||||
//multidex
|
//multidex
|
||||||
|
@ -70,8 +70,7 @@
|
|||||||
android:name=".ReaderActivity">
|
android:name=".ReaderActivity">
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".ImageActivity"
|
android:name=".ImageActivity">
|
||||||
android:theme="@style/Theme.AppCompat.ImageActivity">
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<meta-data android:name="android.webkit.WebView.MetricsOptOut"
|
<meta-data android:name="android.webkit.WebView.MetricsOptOut"
|
||||||
|
@ -3,7 +3,6 @@ package bou.amine.apps.readerforselfossv2.android
|
|||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.constraintlayout.motion.widget.MotionLayout
|
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.FragmentActivity
|
import androidx.fragment.app.FragmentActivity
|
||||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||||
@ -24,6 +23,7 @@ class ImageActivity : AppCompatActivity() {
|
|||||||
setContentView(view)
|
setContentView(view)
|
||||||
|
|
||||||
setSupportActionBar(binding.toolBar)
|
setSupportActionBar(binding.toolBar)
|
||||||
|
supportActionBar?.setDisplayShowTitleEnabled(false)
|
||||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||||
|
|
||||||
allImages = intent.getStringArrayListExtra("allImages") as ArrayList<String>
|
allImages = intent.getStringArrayListExtra("allImages") as ArrayList<String>
|
||||||
@ -31,35 +31,12 @@ class ImageActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
binding.pager.adapter = ScreenSlidePagerAdapter(this)
|
binding.pager.adapter = ScreenSlidePagerAdapter(this)
|
||||||
binding.pager.setCurrentItem(position, false)
|
binding.pager.setCurrentItem(position, false)
|
||||||
|
|
||||||
val transitionListener = object : MotionLayout.TransitionListener {
|
|
||||||
override fun onTransitionStarted(motionLayout: MotionLayout?, startId: Int, endId: Int) {
|
|
||||||
// Nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onTransitionChange(motionLayout: MotionLayout?, startId: Int, endId: Int, progress: Float
|
|
||||||
) {
|
|
||||||
// Nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onTransitionCompleted(motionLayout: MotionLayout?, currentId: Int) {
|
|
||||||
if (motionLayout?.currentState == binding.root.endState) {
|
|
||||||
onBackPressedDispatcher.onBackPressed()
|
|
||||||
overridePendingTransition(0, 0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onTransitionTrigger(motionLayout: MotionLayout?, triggerId: Int, positive: Boolean, progress: Float) {
|
|
||||||
// Nothing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
binding.root.setTransitionListener(transitionListener)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
when (item.itemId) {
|
when (item.itemId) {
|
||||||
android.R.id.home -> {
|
android.R.id.home -> {
|
||||||
onBackPressedDispatcher.onBackPressed()
|
onBackPressed()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,40 +1,33 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.motion.widget.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/container"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
app:layoutDescription="@xml/image_close_scene">
|
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/appBarLayout"
|
android:id="@+id/appBarLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar android:theme="@style/ToolBarStyle"
|
<androidx.appcompat.widget.Toolbar
|
||||||
android:id="@+id/toolBar"
|
android:id="@+id/toolBar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<androidx.viewpager2.widget.ViewPager2
|
||||||
android:id="@+id/scrollView"
|
android:id="@+id/pager"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="0dp"
|
||||||
android:fillViewport="true"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/appBarLayout">
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/appBarLayout" />
|
||||||
|
|
||||||
<androidx.viewpager2.widget.ViewPager2
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
android:id="@+id/pager"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
|
||||||
</androidx.core.widget.NestedScrollView>
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.motion.widget.MotionLayout>
|
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<com.github.chrisbanes.photoview.PhotoView
|
<com.github.chrisbanes.photoview.PhotoView
|
||||||
android:id="@+id/photoView"
|
android:id="@+id/photoView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
android:background="@drawable/checkerboard"
|
android:background="@drawable/checkerboard"
|
||||||
app:srcCompat="@android:drawable/screen_background_dark" />
|
app:srcCompat="@android:drawable/screen_background_dark" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</RelativeLayout>
|
@ -12,5 +12,4 @@
|
|||||||
<color name="refresh_progress_2">@color/colorAccent</color>
|
<color name="refresh_progress_2">@color/colorAccent</color>
|
||||||
<color name="refresh_progress_3">@color/pink</color>
|
<color name="refresh_progress_3">@color/pink</color>
|
||||||
<color name="dark">#FF282828</color>
|
<color name="dark">#FF282828</color>
|
||||||
<color name="transparent_dark_background">#33000000</color>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -26,10 +26,4 @@
|
|||||||
<item name="android:textColorSecondary">@color/white</item>
|
<item name="android:textColorSecondary">@color/white</item>
|
||||||
<item name="actionMenuTextColor">@color/white</item>
|
<item name="actionMenuTextColor">@color/white</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.AppCompat.ImageActivity" parent="NoBar">
|
|
||||||
<item name="android:windowBackground">@color/transparent_dark_background</item>
|
|
||||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
|
||||||
<item name="android:windowIsTranslucent">true</item>
|
|
||||||
</style>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:motion="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:id="@+id/motionLayout">
|
|
||||||
|
|
||||||
<Transition
|
|
||||||
motion:constraintSetStart="@+id/start"
|
|
||||||
motion:constraintSetEnd="@+id/end"
|
|
||||||
motion:duration="500"
|
|
||||||
motion:motionInterpolator="linear">
|
|
||||||
|
|
||||||
<OnSwipe
|
|
||||||
motion:touchAnchorId="@+id/scrollView"
|
|
||||||
motion:touchAnchorSide="top"
|
|
||||||
motion:onTouchUp="autoCompleteToStart" />
|
|
||||||
</Transition>
|
|
||||||
|
|
||||||
<ConstraintSet android:id="@+id/start">
|
|
||||||
|
|
||||||
<Constraint
|
|
||||||
android:id="@id/scrollView"
|
|
||||||
motion:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
motion:layout_constraintTop_toBottomOf="@+id/appBarLayout"
|
|
||||||
motion:layout_constraintEnd_toEndOf="parent"
|
|
||||||
motion:layout_constraintStart_toStartOf="parent">
|
|
||||||
</Constraint>
|
|
||||||
</ConstraintSet>
|
|
||||||
|
|
||||||
<ConstraintSet android:id="@+id/end">
|
|
||||||
|
|
||||||
<Constraint
|
|
||||||
android:id="@+id/scrollView"
|
|
||||||
android:layout_width="100dp"
|
|
||||||
android:layout_height="100dp"
|
|
||||||
android:layout_marginBottom="0dp"
|
|
||||||
motion:layout_constraintStart_toStartOf="parent"
|
|
||||||
motion:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
motion:layout_constraintEnd_toEndOf="parent">
|
|
||||||
</Constraint>
|
|
||||||
</ConstraintSet>
|
|
||||||
</MotionScene>
|
|
Loading…
Reference in New Issue
Block a user