From a381606bf1d7ebf092819a3f57b116a920a096d4 Mon Sep 17 00:00:00 2001 From: M M Arif Date: Tue, 26 Sep 2023 07:33:27 +0000 Subject: [PATCH] Fix regressions in 5.2.0 release (#1309) As title Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/1309 Co-authored-by: M M Arif Co-committed-by: M M Arif --- .gitea/pull_request_template.md | 2 +- app/build.gradle | 51 +++++++++---------- .../mian/gitnex/activities/MainActivity.java | 21 +++++++- .../OrganizationDetailActivity.java | 21 ++++---- .../helpers/ViewPager2Transformers.java | 2 +- app/src/main/res/values-v31/themes.xml | 2 +- 6 files changed, 57 insertions(+), 42 deletions(-) diff --git a/.gitea/pull_request_template.md b/.gitea/pull_request_template.md index 96fb4b18..23953fb2 100644 --- a/.gitea/pull_request_template.md +++ b/.gitea/pull_request_template.md @@ -5,7 +5,7 @@ -- [ ] I carefully read the [contribution guidelines](https://codeberg.org/GitNex/GitNex/src/branch/main/CONTRIBUTING.md). +- [ ] I carefully read the [contribution guidelines](https://codeberg.org/gitnex/GitNex/wiki/Contributing). - [ ] I'm following the code standards as defined [here](https://codeberg.org/gitnex/GitNex/wiki/Code-Standards). - [ ] By submitting this pull request, I permit GitNex to license my work under the [GNU General Public License v3](https://codeberg.org/GitNex/GitNex/src/branch/main/LICENSE). \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 8d58ac7c..1988c22a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -54,20 +54,16 @@ configurations { } dependencies { - def lifecycle_version = '2.6.2' - def markwon_version = '4.6.2' - def work_version = '2.8.1' - def acra = '5.9.7' implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'com.google.android.material:material:1.11.0-alpha02' - implementation 'androidx.compose.material3:material3:1.2.0-alpha07' - implementation 'androidx.compose.material3:material3-window-size-class:1.2.0-alpha07' + implementation 'com.google.android.material:material:1.11.0-alpha03' + implementation 'androidx.compose.material3:material3:1.2.0-alpha08' + implementation 'androidx.compose.material3:material3-window-size-class:1.2.0-alpha08' implementation 'androidx.viewpager2:viewpager2:1.1.0-beta02' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation "androidx.legacy:legacy-support-v4:1.0.0" - implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version" + implementation "androidx.lifecycle:lifecycle-viewmodel:2.6.2" testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' @@ -81,33 +77,34 @@ dependencies { implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.2' implementation 'org.ocpsoft.prettytime:prettytime:5.0.7.Final' implementation 'com.github.Pes8:android-material-color-picker-dialog:master' - implementation "io.noties.markwon:core:$markwon_version" - implementation "io.noties.markwon:ext-latex:$markwon_version" - implementation "io.noties.markwon:ext-strikethrough:$markwon_version" - implementation "io.noties.markwon:ext-tables:$markwon_version" - implementation "io.noties.markwon:ext-tasklist:$markwon_version" - implementation "io.noties.markwon:html:$markwon_version" - implementation "io.noties.markwon:image:$markwon_version" - implementation "io.noties.markwon:image-picasso:$markwon_version" - implementation "io.noties.markwon:linkify:$markwon_version" - implementation "io.noties.markwon:recycler:$markwon_version" - implementation "io.noties.markwon:recycler-table:$markwon_version" - implementation "io.noties.markwon:simple-ext:$markwon_version" - implementation 'com.google.guava:guava:31.1-jre' - implementation "io.noties.markwon:image-picasso:$markwon_version" + implementation "io.noties.markwon:core:4.6.2" + implementation "io.noties.markwon:ext-latex:4.6.2" + implementation "io.noties.markwon:ext-strikethrough:4.6.2" + implementation "io.noties.markwon:ext-tables:4.6.2" + implementation "io.noties.markwon:ext-tasklist:4.6.2" + implementation "io.noties.markwon:html:4.6.2" + implementation "io.noties.markwon:image:4.6.2" + implementation "io.noties.markwon:image-picasso:4.6.2" + implementation "io.noties.markwon:linkify:4.6.2" + implementation "io.noties.markwon:recycler:4.6.2" + implementation "io.noties.markwon:recycler-table:4.6.2" + implementation "io.noties.markwon:simple-ext:4.6.2" + implementation 'com.google.guava:guava:32.1.2-jre' + implementation "io.noties.markwon:image-picasso:4.6.2" implementation "com.github.HamidrezaAmz:BreadcrumbsView:0.2.9" //noinspection GradleDependency implementation 'commons-io:commons-io:2.5' - implementation 'org.apache.commons:commons-lang3:3.12.0' + implementation 'org.apache.commons:commons-lang3:3.13.0' implementation "com.github.chrisbanes:PhotoView:2.3.0" - implementation "ch.acra:acra-mail:$acra" - implementation "ch.acra:acra-limiter:$acra" - implementation "ch.acra:acra-notification:$acra" + implementation 'ch.acra:acra-mail:5.11.2' + implementation 'ch.acra:acra-limiter:5.11.2' + implementation 'ch.acra:acra-notification:5.11.2' implementation 'androidx.room:room-runtime:2.5.2' annotationProcessor 'androidx.room:room-compiler:2.5.2' - implementation "androidx.work:work-runtime:$work_version" + implementation "androidx.work:work-runtime:2.8.1" implementation "io.mikael:urlbuilder:2.0.9" implementation "org.codeberg.gitnex-garage:emoji-java:v5.1.2" + //noinspection GradleDependency coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5" implementation 'androidx.biometric:biometric:1.1.0' implementation 'com.github.chrisvest:stormpot:2.4.2' diff --git a/app/src/main/java/org/mian/gitnex/activities/MainActivity.java b/app/src/main/java/org/mian/gitnex/activities/MainActivity.java index ef90eabf..36593325 100644 --- a/app/src/main/java/org/mian/gitnex/activities/MainActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/MainActivity.java @@ -521,7 +521,24 @@ public class MainActivity extends BaseActivity } } - loadUserInfo(); + handler.postDelayed( + () -> { + boolean connToInternet = AppUtil.hasNetworkConnection(appCtx); + if (!connToInternet) { + + if (!noConnection) { + Toasty.error( + ctx, getResources().getString(R.string.checkNetConnection)); + } + noConnection = true; + } else { + + loadUserInfo(); + noConnection = false; + } + }, + 750); + handler.postDelayed( () -> { boolean connToInternet = AppUtil.hasNetworkConnection(appCtx); @@ -901,7 +918,7 @@ public class MainActivity extends BaseActivity String toastError = getResources() .getString(R.string.genericApiError, response.code()); - Toasty.error(ctx, toastError); + // Toasty.error(ctx, toastError); } } diff --git a/app/src/main/java/org/mian/gitnex/activities/OrganizationDetailActivity.java b/app/src/main/java/org/mian/gitnex/activities/OrganizationDetailActivity.java index ed2928c8..3ccd3b67 100644 --- a/app/src/main/java/org/mian/gitnex/activities/OrganizationDetailActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/OrganizationDetailActivity.java @@ -15,6 +15,8 @@ import androidx.viewpager2.adapter.FragmentStateAdapter; import androidx.viewpager2.widget.ViewPager2; import com.google.android.material.tabs.TabLayoutMediator; import io.mikael.urlbuilder.UrlBuilder; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; import org.gitnex.tea4j.v2.models.OrganizationPermissions; import org.mian.gitnex.R; @@ -129,25 +131,24 @@ public class OrganizationDetailActivity extends BaseActivity implements BottomSh ViewPager2Transformers.returnSelectedTransformer( viewPager, tinyDB.getInt("fragmentTabsAnimationId", 0)); - String[] tabTitles = { - getResources().getString(R.string.tabTextInfo), - getResources().getString(R.string.navRepos), - getResources().getString(R.string.newIssueLabelsTitle), - getResources().getString(R.string.orgTabTeams), - getResources().getString(R.string.orgTabMembers) - }; + List tabsList = new ArrayList<>(); + tabsList.add(getResources().getString(R.string.tabTextInfo)); + tabsList.add(getResources().getString(R.string.navRepos)); + tabsList.add(getResources().getString(R.string.newIssueLabelsTitle)); + tabsList.add(getResources().getString(R.string.orgTabTeams)); + tabsList.add(getResources().getString(R.string.orgTabMembers)); if (!isMember) { - activityOrgDetailBinding.tabs.removeTabAt(3); + tabsList.remove(3); } new TabLayoutMediator( activityOrgDetailBinding.tabs, viewPager, - (tab, position) -> tab.setText(tabTitles[position])) + (tab, position) -> tab.setText(tabsList.get(position))) .attach(); - for (int j = 0; j < tabTitles.length; j++) { + for (int j = 0; j < tabsList.size(); j++) { ViewGroup vgTab = (ViewGroup) vg.getChildAt(j); int tabChildCount = vgTab.getChildCount(); diff --git a/app/src/main/java/org/mian/gitnex/helpers/ViewPager2Transformers.java b/app/src/main/java/org/mian/gitnex/helpers/ViewPager2Transformers.java index 86b2d4e6..9b256a97 100644 --- a/app/src/main/java/org/mian/gitnex/helpers/ViewPager2Transformers.java +++ b/app/src/main/java/org/mian/gitnex/helpers/ViewPager2Transformers.java @@ -41,7 +41,7 @@ public abstract class ViewPager2Transformers { view.setAlpha(1 - position); // Counteract the default slide transition - view.setTranslationX(pageWidth * -position); + // view.setTranslationX(pageWidth * -position); // Scale the page down (between MIN_SCALE and 1) float scaleFactor = MIN_SCALE + (1 - MIN_SCALE) * (1 - Math.abs(position)); diff --git a/app/src/main/res/values-v31/themes.xml b/app/src/main/res/values-v31/themes.xml index bb572ae7..36b90d5e 100644 --- a/app/src/main/res/values-v31/themes.xml +++ b/app/src/main/res/values-v31/themes.xml @@ -44,7 +44,7 @@ 1 -