Skip to content

Commit

Permalink
Refactor - [:core:common] Apply & Fix Ktlint & Detekt Rules (#2672)
Browse files Browse the repository at this point in the history
* Refactor - [:core:common] Apply & Fix Ktlint & Detekt Rules

Jira tasks - [MM-56](https://mifosforge.jira.com/browse/MM-56)

* feat: add getTodayFormatted function

Added a new function `getTodayFormatted` to `DateHelper.kt` which returns today's date in "
dd-MM-yyyy" format.

* Refactor - [:core:common] Apply & Fix Ktlint & Detekt Rules

Jira tasks - [MM-56](https://mifosforge.jira.com/browse/MM-56)
  • Loading branch information
niyajali authored Aug 27, 2024
1 parent eb0f4b4 commit de8a26b
Show file tree
Hide file tree
Showing 68 changed files with 1,326 additions and 282 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://editorconfig.org/
# This configuration is used by ktlint when spotless invokes it

[*.{kt,kts}]
ij_kotlin_allow_trailing_comma=true
ij_kotlin_allow_trailing_comma_on_call_site=true
ktlint_function_naming_ignore_when_annotated_with=Composable, Test, Preview
2 changes: 1 addition & 1 deletion androidApp/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<application
android:name=".MifosSelfServiceApp"
android:allowBackup="true"
android:icon="@mipmap/mifos_icon"
android:icon="@mipmap/core_common_mifos_icon"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.google.firebase.messaging.FirebaseMessagingService
import com.google.firebase.messaging.RemoteMessage
import org.mifos.mobile.R
import org.mifos.mobile.core.datastore.model.MifosNotification
import org.mifos.mobile.ui.activities.HomeActivity

class MifosFirebaseMessagingService : FirebaseMessagingService() {
Expand Down Expand Up @@ -62,7 +61,7 @@ class MifosFirebaseMessagingService : FirebaseMessagingService() {
)
val defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)
val notificationBuilder = NotificationCompat.Builder(this)
.setSmallIcon(R.mipmap.mifos_icon)
.setSmallIcon(R.mipmap.core_common_mifos_icon)
.setContentTitle(getString(R.string.app_name))
.setContentText(message)
.setAutoCancel(true)
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/layout/activity_accounts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
android:layout_height="match_parent"
android:orientation="vertical">

<include layout="@layout/toolbar" />
<include layout="@layout/core_common_toolbar" />

<FrameLayout style="@style/FrameLayout.Container" />
</LinearLayout>
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/layout/activity_container.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
android:layout_height="match_parent"
android:orientation="vertical">

<include layout="@layout/toolbar" />
<include layout="@layout/core_common_toolbar" />

<FrameLayout style="@style/FrameLayout.Container" />
</LinearLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
android:layout_height="match_parent"
android:orientation="vertical">

<include layout="@layout/toolbar" />
<include layout="@layout/core_common_toolbar" />

<FrameLayout
android:id="@+id/container"
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/layout/activity_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:layout_height="match_parent"
android:orientation="vertical">

<include layout="@layout/toolbar" />
<include layout="@layout/core_common_toolbar" />

<FrameLayout style="@style/FrameLayout.Container" />
</LinearLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
android:layout_height="match_parent"
android:orientation="vertical">

<include layout="@layout/toolbar" />
<include layout="@layout/core_common_toolbar" />

<FrameLayout style="@style/FrameLayout.Container" />
</LinearLayout>
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/layout/activity_notification.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
android:layout_height="match_parent"
android:orientation="vertical">

<include layout="@layout/toolbar" />
<include layout="@layout/core_common_toolbar" />

<FrameLayout style="@style/FrameLayout.Container" />
</LinearLayout>
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/layout/activity_privacy_policy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
android:layout_height="match_parent"
android:orientation="vertical">

<include layout="@layout/toolbar" />
<include layout="@layout/core_common_toolbar" />

<WebView
android:id="@+id/webView"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
android:layout_height="match_parent"
android:orientation="vertical">

<include layout="@layout/toolbar" />
<include layout="@layout/core_common_toolbar" />

<FrameLayout style="@style/FrameLayout.Container" />

Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
android:layout_height="match_parent"
android:orientation="vertical">

<include layout="@layout/toolbar" />
<include layout="@layout/core_common_toolbar" />

<FrameLayout style="@style/FrameLayout.Container" />
</LinearLayout>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2024 Mifos Initiative
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file,
You can obtain one at https://mozilla.org/MPL/2.0/.
See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md
-->
<com.google.android.material.appbar.MaterialToolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<string name="share">شارك</string>
<string name="share_account">حصة الحساب</string>
<string name="clients_list">شيء العميل</string>
<string name="working">العمل</string>
<string name="core_common_working">العمل</string>
<string name="status_image">صورة الحالة</string>
<string name="loan_repayment_schedule">جدول الدفع</string>
<string name="last_transaction">آخر معاملة</string>
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/values-bn/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<string name="share">শেয়ার</string>
<string name="share_account">আপনার অ্যাকাউন্ট শেয়ার করুন</string>
<string name="clients_list">একটি গ্রাহক চয়ন করুন</string>
<string name="working">কাজ</string>
<string name="core_common_working">কাজ</string>
<string name="status_image">রাষ্ট্রের ছবি</string>
<string name="loan_repayment_schedule">পরিশোধের সময়সূচী</string>
<string name="last_transaction">শেষ লেনদেন</string>
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<string name="share">Cuota</string>
<string name="share_account">Comparte tu cuenta</string>
<string name="clients_list">Elige un cliente</string>
<string name="working">Laboral</string>
<string name="core_common_working">Laboral</string>
<string name="status_image">Imagen del estado</string>
<string name="loan_repayment_schedule">Calendario de reembolso</string>
<string name="last_transaction">Ultima transaccion</string>
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/values-fa-rAF/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@
<string name="withdrawal_date">تاریخ برداشت</string>
<string name="withdrawal_transfer">انتقال برداشت</string>
<string name="withdrawn">برداشت</string>
<string name="working">کار کردن</string>
<string name="core_common_working">کار کردن</string>
<string name="yes">بلي</string>
<string name="app_info">اطلاعات برنامه</string>
<string name="login_failed">ورود ناموفق بود، لطفاً بعداً دوباره امتحان کنید.</string>
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<string name="share">Part</string>
<string name="share_account">Partagez votre compte</string>
<string name="clients_list">Choisissez un client</string>
<string name="working">Travail</string>
<string name="core_common_working">Travail</string>
<string name="status_image">Image de l\'état</string>
<string name="loan_repayment_schedule">Calendrier de remboursement</string>
<string name="last_transaction">Dernière transaction</string>
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/values-hi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<string name="share">शेयर</string>
<string name="share_account">शेयर खाता</string>
<string name="clients_list">एक ग्राहक चुनें</string>
<string name="working">काम कर रहे</string>
<string name="core_common_working">काम कर रहे</string>
<string name="submitted">जमा किया गया</string>
<string name="disbursement">अदायगी</string>
<string name="status_image">स्थिति छवि</string>
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/values-in/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<string name="share">Saham</string>
<string name="share_account">Bagikan akun Anda</string>
<string name="clients_list">Pilih pelanggan</string>
<string name="working">Kerja</string>
<string name="core_common_working">Kerja</string>
<string name="status_image">Citra negara</string>
<string name="loan_repayment_schedule">Jadwal pembayaran kembali</string>
<string name="last_transaction">Transaksi terakhir</string>
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/values-km/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<string name="share">ចែករំលែក</string>
<string name="share_account">ចែករំលែកគណនីរបស់អ្នក</string>
<string name="clients_list">ជ្រើសរើសអតិថិជន</string>
<string name="working">ធ្វើការ</string>
<string name="core_common_working">ធ្វើការ</string>
<string name="status_image">រូបភាពរបស់រដ្ឋ</string>
<string name="loan_repayment_schedule">កាលវិភាគសងប្រាក់</string>
<string name="last_transaction">កិច្ចការចុងក្រោយ</string>
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/values-kn/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<string name="share">ಹಂಚಿಕೊಳ್ಳಿ</string>
<string name="share_account">ನಿಮ್ಮ ಖಾತೆಯನ್ನು ಹಂಚಿಕೊಳ್ಳಿ</string>
<string name="clients_list">ಗ್ರಾಹಕರನ್ನು ಆಯ್ಕೆ ಮಾಡಿ</string>
<string name="working">ಕೆಲಸ</string>
<string name="core_common_working">ಕೆಲಸ</string>
<string name="status_image">ರಾಜ್ಯದ ಚಿತ್ರ</string>
<string name="loan_repayment_schedule">ಮರುಪಾವತಿಯ ವೇಳಾಪಟ್ಟಿ</string>
<string name="last_transaction">ಕೊನೆಯ ವಹಿವಾಟು</string>
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/values-my/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<string name="share">ဝေစု</string>
<string name="share_account">ဝေမျှမယ်အကောင့်</string>
<string name="clients_list">တစ်ဦးကို client ကို ရွေးချယ်.</string>
<string name="working">အလုပ်အဖွဲ့</string>
<string name="core_common_working">အလုပ်အဖွဲ့</string>
<string name="status_image">အဆင့်အတန်းပုံရိပ်</string>
<string name="loan_repayment_schedule">ပြန်ဆပ်ဇယား</string>
<string name="last_transaction">နောက်ဆုံးငွေသွင်းငွေထုတ်</string>
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<string name="share">Udostępnij</string>
<string name="share_account">Udostępnij konto</string>
<string name="clients_list">Wybierz klienta</string>
<string name="working">Pracujący</string>
<string name="core_common_working">Pracujący</string>
<string name="status_image">Obraz stanu</string>
<string name="loan_repayment_schedule">Harmonogram spłaty</string>
<string name="last_transaction">Ostatnia transakcja</string>
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<string name="share">Partilhar</string>
<string name="share_account">Partilhar conta</string>
<string name="clients_list">Escolheu um cliente</string>
<string name="working">A trabalhar</string>
<string name="core_common_working">A trabalhar</string>
<string name="status_image">Imagem de Status</string>
<string name="loan_repayment_schedule">Cronograma de Reembolso</string>
<string name="last_transaction">Última Transação </string>
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<string name="share">Доля</string>
<string name="share_account">Поделитесь своим аккаунтом</string>
<string name="clients_list">Выберите клиента</string>
<string name="working">Работа</string>
<string name="core_common_working">Работа</string>
<string name="status_image">Изображение государства</string>
<string name="loan_repayment_schedule">График погашения</string>
<string name="last_transaction">Последняя сделка</string>
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/values-sw/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<string name="share">Kushiriki</string>
<string name="share_account">Shiriki akaunti yako</string>
<string name="clients_list">Chagua mteja</string>
<string name="working">Kazi</string>
<string name="core_common_working">Kazi</string>
<string name="status_image">Picha ya hali</string>
<string name="loan_repayment_schedule">Ratiba ya kulipa</string>
<string name="last_transaction">Shughuli ya mwisho</string>
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/values-te/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<string name="share">వాటా</string>
<string name="share_account">వాటా ఖాతా</string>
<string name="clients_list">ఒక క్లయింట్ ఎంచుకోండి</string>
<string name="working">వర్కింగ్</string>
<string name="core_common_working">వర్కింగ్</string>
<string name="status_image">స్థితి చిత్రం</string>
<string name="loan_repayment_schedule">తిరిగి చెల్లింపు షెడ్యూల్</string>
<string name="last_transaction">చివరి లావాదేవీ</string>
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/values-ur/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<string name="share">اشتراک کریں</string>
<string name="share_account">اکاؤنٹ کا اشتراک کریں</string>
<string name="clients_list">کسٹمر چیز</string>
<string name="working">کام کر رہے ہیں</string>
<string name="core_common_working">کام کر رہے ہیں</string>
<string name="status_image">موجودہ حالت کی تصویر</string>
<string name="loan_repayment_schedule">قرض کی ادائیگی کی شیڈول</string>
<string name="last_transaction">پچھلا ٹرانزیکشن</string>
Expand Down
4 changes: 2 additions & 2 deletions androidApp/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@


<!-- Dimen values for Account Status-->
<dimen name="account_status_width">25dp</dimen>
<dimen name="account_status_height">25dp</dimen>
<dimen name="core_common_account_status_width">25dp</dimen>
<dimen name="core_common_account_status_height">25dp</dimen>

<!-- Dimen values for Account Status-->
<dimen name="dashboard_status_width">55dp</dimen>
Expand Down
8 changes: 4 additions & 4 deletions androidApp/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<string name="share">Share</string>
<string name="share_account">Share Account</string>
<string name="clients_list">Chose a client</string>
<string name="working">Working</string>
<string name="core_common_working">Working</string>
<string name="status_image">Status Image</string>
<string name="loan_repayment_schedule">Repayment Schedule</string>
<string name="last_transaction">Last Transaction</string>
Expand Down Expand Up @@ -510,8 +510,8 @@
<string name="scan_your_fingerprint">Scan your fingerprint</string>


<string name="language_type" translatable="false">language_type</string>
<string name="default_system_language" translatable="false">default_system_language</string>
<string name="core_common_language_type" translatable="false">language_type</string>
<string name="core_common_default_system_language" translatable="false">default_system_language</string>
<string name="theme_type" translatable="false">theme_type</string>
<string name="total_saving_balance">Total Savings Balance</string>
<string name="total_loan_balance">Total Loan Balance</string>
Expand Down Expand Up @@ -599,7 +599,7 @@
<item>فارسی</item>
</string-array>

<string-array name="languages_value" translatable="false">
<string-array name="core_common_languages_value" translatable="false">
<item>System_Language</item>
<item>en</item>
<item>hi</item>
Expand Down
4 changes: 2 additions & 2 deletions androidApp/src/main/res/xml/settings_preference.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
<androidx.preference.ListPreference
android:defaultValue="System_Language"
android:entries="@array/languages"
android:entryValues="@array/languages_value"
android:entryValues="@array/core_common_languages_value"
android:icon="@drawable/ic_translate"
android:key="@string/language_type"
android:key="@string/core_common_language_type"
android:summary="@string/choose_language"
android:title="@string/language" />

Expand Down
Loading

0 comments on commit de8a26b

Please sign in to comment.