Skip to content

Commit

Permalink
Merge pull request #474 from Reco1I/1-8-1-corrections
Browse files Browse the repository at this point in the history
Corrections after 1.8.1 release
  • Loading branch information
Rian8337 authored Dec 26, 2024
2 parents 5e3a87e + 4d1776d commit a5e02c8
Show file tree
Hide file tree
Showing 22 changed files with 566 additions and 439 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public MarkdownWebView(Context context, AttributeSet attrs, int defStyleAttr, in

@SuppressLint("SetJavaScriptEnabled")
void init(Context context) {
this.setBackgroundColor(Color.TRANSPARENT);
this.setBackgroundColor(Color.WHITE);

this.getSettings().setBlockNetworkLoads(true);
this.getSettings().setLoadWithOverviewMode(true);
Expand Down
64 changes: 64 additions & 0 deletions res/layout/dialog_progress.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/frg_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#80000000"
android:elevation="1dp">

<LinearLayout
android:id="@+id/frg_body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"
android:background="@drawable/rounded_rect"
android:backgroundTint="#1E1E2E"
android:divider="@drawable/divider"
android:gravity="center"
android:minWidth="200dp"
android:orientation="vertical"
android:showDividers="middle">

<TextView
android:id="@+id/title"
style="@style/settings_tab_divider"
android:paddingVertical="12dp"
android:text="Title" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:padding="12dp">

<com.google.android.material.progressindicator.CircularProgressIndicator
android:id="@+id/progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true"
android:padding="10dp"
app:indicatorColor="@color/colorAccent"
app:indicatorDirectionCircular="counterclockwise"
app:trackCornerRadius="12dp"
tools:indeterminate="false"
tools:progress="50" />

<TextView
android:id="@+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="12dp"
android:maxWidth="400dp"
android:textColor="#FFF"
tools:text="Message" />

</LinearLayout>

</LinearLayout>

</RelativeLayout>
15 changes: 10 additions & 5 deletions src/com/edlplan/ui/fragment/BaseFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,32 @@ import androidx.fragment.app.Fragment
import com.edlplan.framework.easing.Easing
import com.edlplan.ui.ActivityOverlay
import com.edlplan.ui.EasingHelper
import com.reco1l.osu.*
import ru.nsu.ccfit.zuev.osuplus.R

abstract class BaseFragment : Fragment(), BackPressListener {
var root: View? = null
private set
private var background: View? = null
var onDismissListener: OnDismissListener? = null
var isDismissOnBackgroundClick = false
var isCreated = false
private set
var isDismissOnBackPress = true

/**
* Whether the fragment is created. This is set to true after [onCreateView] is called.
*/
var isCreated = false
private set

/**
* If true, the fragment will intercept back press event when it's received.
*/
var interceptBackPress = true

/**
* Whether the fragment is loaded. This is set to true after [onLoadView] is called.
*/
var isLoaded = false
private set

private var isLoaded = false

private var isDismissCalled = false

Expand Down
4 changes: 2 additions & 2 deletions src/com/edlplan/ui/fragment/MarkdownFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public MarkdownFragment setTitle(@StringRes int title) {
}

protected void playOnLoadAnim() {
View body = findViewById(R.id.frg_body);
View body = findViewById(R.id.fullLayout);
body.setTranslationY(500);
body.animate().cancel();
body.animate()
Expand All @@ -76,7 +76,7 @@ protected void playOnLoadAnim() {
}

protected void playOnDismissAnim(Runnable runnable) {
View body = findViewById(R.id.frg_body);
View body = findViewById(R.id.fullLayout);
body.animate().cancel();
body.animate()
.translationY(500)
Expand Down
16 changes: 6 additions & 10 deletions src/com/reco1l/framework/net/FileRequest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class FileRequest(val file: File, url: HttpUrl): WebRequest(url) {
/**
* The download observer.
*/
var observer: IDownloaderObserver? = null
var observer: IFileRequestObserver? = null

/**
* Whether the download is in progress, this is set to true once [execute] is called.
Expand Down Expand Up @@ -116,13 +116,9 @@ class FileRequest(val file: File, url: HttpUrl): WebRequest(url) {
}


interface IDownloaderObserver
{
fun onDownloadEnd(downloader: FileRequest) = Unit

fun onDownloadCancel(downloader: FileRequest) = Unit

fun onDownloadUpdate(downloader: FileRequest) = Unit

fun onDownloadFail(downloader: FileRequest, exception: Exception) = Unit
interface IFileRequestObserver {
fun onDownloadEnd(request: FileRequest) = Unit
fun onDownloadCancel(request: FileRequest) = Unit
fun onDownloadUpdate(request: FileRequest) = Unit
fun onDownloadFail(request: FileRequest, exception: Exception) = Unit
}
Loading

0 comments on commit a5e02c8

Please sign in to comment.