diff --git a/app/build.gradle b/app/build.gradle index f5237eaafe..2aa7a37c33 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 21 targetSdkVersion 34 - versionCode 1143 - versionName "0.11.43" + versionCode 1144 + versionName "0.11.44" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/enterprises/FinanceFragment.java b/app/src/main/java/org/ole/planet/myplanet/ui/enterprises/FinanceFragment.java index 190b3494cd..b9bfa15d7c 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/enterprises/FinanceFragment.java +++ b/app/src/main/java/org/ole/planet/myplanet/ui/enterprises/FinanceFragment.java @@ -62,6 +62,13 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa fragmentFinanceBinding.rvFinance.setAdapter(adapterFinance); isAsc = !isAsc; }); + fragmentFinanceBinding.btnReset.setOnClickListener(view -> { + list = mRealm.where(RealmMyTeam.class).notEqualTo("status", "archived").equalTo("teamId", teamId).equalTo("docType", "transaction").sort("date", Sort.DESCENDING).findAll(); + adapterFinance = new AdapterFinance(getActivity(), list); + fragmentFinanceBinding.rvFinance.setLayoutManager(new LinearLayoutManager(getActivity())); + fragmentFinanceBinding.rvFinance.setAdapter(adapterFinance); + calculateTotal(list); + }); return fragmentFinanceBinding.getRoot(); } @@ -78,6 +85,7 @@ private void showDatePickerDialog() { fragmentFinanceBinding.rvFinance.setAdapter(adapterFinance); calculateTotal(list); }, now.get(Calendar.YEAR), now.get(Calendar.MONTH), now.get(Calendar.DAY_OF_MONTH)).show(getActivity().getFragmentManager(), ""); + } @Override diff --git a/app/src/main/res/layout/fragment_finance.xml b/app/src/main/res/layout/fragment_finance.xml index 26146b23f2..cd5630a9f3 100644 --- a/app/src/main/res/layout/fragment_finance.xml +++ b/app/src/main/res/layout/fragment_finance.xml @@ -11,15 +11,32 @@ android:layout_height="match_parent" android:orientation="vertical"> -