Skip to content

Commit

Permalink
community: add date reset to finance (fixes #1982) (#2699)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
BryanGazali and dogi authored Nov 13, 2023
1 parent 8e94a12 commit fa4df91
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand All @@ -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
Expand Down
33 changes: 25 additions & 8 deletions app/src/main/res/layout/fragment_finance.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,32 @@
android:layout_height="match_parent"
android:orientation="vertical">

<Button
android:id="@+id/btn_filter"
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:padding="@dimen/padding_normal"
android:text="@string/filter_by_date"
android:textSize="18sp"
android:theme="@style/GuestStyle" />
android:orientation="horizontal"
android:paddingLeft="@dimen/padding_normal"
android:paddingRight="@dimen/padding_normal">

<Button
android:id="@+id/btn_filter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:padding="@dimen/padding_normal"
android:text="@string/filter_by_date"
android:textSize="18sp"
android:theme="@style/GuestStyle" />
<Button
android:id="@+id/btn_reset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:padding="@dimen/padding_normal"
android:text="@string/date_reset"
android:textSize="18sp"
android:theme="@style/GuestStyle" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -955,5 +955,6 @@
<string name="progress_bar">شريط التقدم</string>
<string name="web_view">عرض الويب</string>
<string name="invalid_configuration">تكوينات الخادم غير صالحة</string>

<string name="date_reset">إعادة ضبط التاريخ</string>

</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -960,5 +960,6 @@
<string name="progress_bar">barra de progreso</string>
<string name="web_view">vista web</string>
<string name="invalid_configuration">Configuraciones de servidor no válidas</string>
<string name="date_reset">Restablecer fecha</string>

</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -960,5 +960,6 @@
<string name="progress_bar">barre de progression</string>
<string name="web_view">vue web</string>
<string name="invalid_configuration">Configurations de serveur invalides</string>
<string name="date_reset">Réinitialisation des dates</string>

</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-ne/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -960,5 +960,6 @@
<string name="progress_bar">प्रगति पट्टि</string>
<string name="web_view">वेब दृश्य</string>
<string name="invalid_configuration">अमान्य सर्भर विन्यास</string>
<string name="date_reset">मिति रिसेट</string>

</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values-so/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -949,5 +949,6 @@
<string name="progress_bar">balka soo socda</string>
<string name="web_view">barashada webka</string>
<string name="invalid_configuration">Dhamaan Suurtagal ah oo Serveryaasha ah</string>
<string name="date_reset">Dib u habeynta taariikhda</string>

</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@
<string name="weekly">Weekly</string>
<string name="recurring_frequency">Recurring Frequency</string>
<string name="filter_by_date">Date Filter</string>
<string name="date_reset">Date Reset</string>
<string name="emergency_contact">Emergency Contact</string>
<string name="contact">Contact</string>
<string name="special_needs">Special Needs</string>
Expand Down

0 comments on commit fa4df91

Please sign in to comment.