Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ apply plugin: 'com.starter.easylauncher'
apply plugin: "com.github.ben-manes.versions"

android {
kotlinOptions.useIR = true
compileSdkVersion(Dependencies.compileSdk)
defaultConfig {
applicationId "xyz.hisname.fireflyiii"
Expand Down Expand Up @@ -75,7 +74,10 @@ android {
}
}

configurations {all*.exclude group: 'com.android.support'}
configurations {
all*.exclude group: 'com.android.support'
all*.exclude group: 'com.google.guava', module: 'listenablefuture'
}
androidResources {
ignoreAssetsPattern 'NOTICE.txt'
}
Expand All @@ -99,7 +101,7 @@ dependencies {
implementation Dependencies.googleMaterialIcons
implementation Dependencies.fontAwesome

coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.0'

implementation Dependencies.toasty
implementation Dependencies.chart
Expand All @@ -117,4 +119,6 @@ dependencies {
// Project Lib
implementation project(path: ":languagepack")

}
}

build.dependsOn(['checkClasspath'])
47 changes: 37 additions & 10 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="android.permission.VIBRATE"/>
Expand All @@ -49,10 +50,14 @@
android:label="@string/app_name"
android:supportsRtl="true"
android:networkSecurityConfig="@xml/network_security_config"
android:theme="@style/AppTheme.StartUpTheme">
android:theme="@style/AppTheme.StartUpTheme"
android:localeConfig="@xml/locales_config"
tools:ignore="UnusedAttribute">

<activity android:name=".ui.onboarding.AuthActivity"
android:launchMode= "singleTask">
<activity
android:name=".ui.onboarding.AuthActivity"
android:launchMode= "singleTask"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
Expand All @@ -72,7 +77,9 @@
</intent-filter>
</activity>

<receiver android:name=".ui.widgets.BalanceWidget">
<receiver
android:name=".ui.widgets.BalanceWidget"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
Expand All @@ -81,7 +88,9 @@
android:resource="@xml/balance_widget_info" />
</receiver>

<receiver android:name=".ui.widgets.AccountListWidget">
<receiver
android:name=".ui.widgets.AccountListWidget"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
Expand All @@ -91,7 +100,9 @@
</receiver>


<receiver android:name=".ui.widgets.BillsToPayWidget">
<receiver
android:name=".ui.widgets.BillsToPayWidget"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
Expand All @@ -102,7 +113,8 @@

<activity
android:name=".ui.HomeActivity"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down Expand Up @@ -149,13 +161,17 @@
</intent-filter>
</receiver>

<receiver android:name=".GenericReceiver">
<receiver
android:name=".GenericReceiver"
android:exported="false">
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>

<service android:name=".service.FireflyAuthenticatorService">
<service
android:name=".service.FireflyAuthenticatorService"
android:exported="false">
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
Expand Down Expand Up @@ -194,7 +210,8 @@
android:name=".service.TransactionTilesService"
android:icon="@drawable/ic_refresh"
android:label="@string/transaction"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
android:exported="true">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE"/>
</intent-filter>
Expand Down Expand Up @@ -233,6 +250,16 @@
android:exported="true">
</provider>-->

<!-- Allows compatibility of language selector for versions lower than 13 -->
<service
android:name="androidx.appcompat.app.AppLocalesMetadataHolderService"
android:enabled="false"
android:exported="false">
<meta-data
android:name="autoStoreLocales"
android:value="true" />
</service>

</application>


Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/xyz/hisname/fireflyiii/CustomApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CustomApp: Application() {
initAcra {
reportFormat = StringFormat.KEY_VALUE_LIST
buildConfigClass = BuildConfig::class.java
reportContent = arrayOf(ReportField.REPORT_ID, ReportField.APP_VERSION_NAME,
reportContent = listOf(ReportField.REPORT_ID, ReportField.APP_VERSION_NAME,
ReportField.PHONE_MODEL, ReportField.BRAND, ReportField.PRODUCT, ReportField.ANDROID_VERSION,
ReportField.BUILD_CONFIG, ReportField.STACK_TRACE, ReportField.LOGCAT)
mailSender {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ class AppPref(private val sharedPref: SharedPreferences): PreferenceHelper {
get() = sharedPref.getString("cert_value", "") ?: ""
set(value) = sharedPref.edit { putString("cert_value", value) }

override var languagePref: String
get() = sharedPref.getString("language_pref", "") ?: "en"
set(value) = sharedPref.edit{ putString("language_pref", value)}

override var nightModeEnabled: Boolean
get() = sharedPref.getBoolean("night_mode", false)
set(value) = sharedPref.edit { putBoolean("night_mode", value) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ interface PreferenceHelper {
var serverVersion: String
var userOs: String
var certValue: String
var languagePref: String
var nightModeEnabled: Boolean
var isKeyguardEnabled: Boolean
var isCurrencyThumbnailEnabled: Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import xyz.hisname.fireflyiii.repository.GlobalViewModel
import xyz.hisname.fireflyiii.util.extension.getCompatColor
import xyz.hisname.fireflyiii.util.extension.getViewModel
import xyz.hisname.fireflyiii.util.getUniqueHash
import xyz.hisname.languagepack.LanguageChanger

@SuppressLint("Registered")
open class BaseActivity: AppCompatActivity() {
Expand All @@ -55,10 +54,6 @@ open class BaseActivity: AppCompatActivity() {
}
}

override fun attachBaseContext(newBase: Context) {
super.attachBaseContext(LanguageChanger.init(newBase, sharedPref(newBase).languagePref))
}

override fun applyOverrideConfiguration(overrideConfiguration: Configuration) {
val uiMode = overrideConfiguration.uiMode
overrideConfiguration.setTo(baseContext.resources.configuration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,29 @@ import androidx.core.view.isVisible
import xyz.hisname.fireflyiii.util.animation.BakedBezierInterpolator
import kotlin.math.max

abstract class BaseAddObjectFragment: BaseFragment() {
abstract class BaseAddObjectFragment : BaseFragment() {

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
setIcons()
setWidgets()
}

protected fun unReveal(rootView: View){
protected fun unReveal(rootView: View) {
val x = rootView.width / 2
val y = rootView.height / 2
val finalRadius = (max(rootView.width, rootView.height) * 1.1).toFloat()
val circularReveal= ViewAnimationUtils.createCircularReveal(
rootView, x, y,finalRadius, 0f)
val circularReveal = ViewAnimationUtils.createCircularReveal(
rootView, x, y, finalRadius, 0f
)
circularReveal.duration = 400
circularReveal.interpolator = BakedBezierInterpolator.FADE_OUT_CURVE
circularReveal.addListener(object : AnimatorListenerAdapter(){
override fun onAnimationEnd(animation: Animator?) {
circularReveal.addListener(object : AnimatorListenerAdapter() {
override fun onAnimationEnd(animation: Animator) {
super.onAnimationEnd(animation)
try {
parentFragmentManager.popBackStack()
} catch(illegal: IllegalStateException){

} catch (_: IllegalStateException) {
}
rootView.isVisible = false
fragmentContainer.isVisible = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ import androidx.lifecycle.asLiveData
import androidx.paging.LoadState
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
import com.kizitonwose.calendarview.CalendarView
import com.kizitonwose.calendarview.model.CalendarDay
import com.kizitonwose.calendarview.model.DayOwner
import com.kizitonwose.calendarview.ui.DayBinder
import com.kizitonwose.calendarview.ui.ViewContainer
import com.kizitonwose.calendar.core.CalendarDay
import com.kizitonwose.calendar.core.DayPosition
import com.kizitonwose.calendar.view.CalendarView
import com.kizitonwose.calendar.view.MonthDayBinder
import com.kizitonwose.calendar.view.ViewContainer
import xyz.hisname.fireflyiii.R
import xyz.hisname.fireflyiii.databinding.CalendarDayBinding
import xyz.hisname.fireflyiii.databinding.DetailsCardBinding
Expand Down Expand Up @@ -149,15 +149,15 @@ class BillDetailsFragment: BaseDetailFragment() {
val onDayText = CalendarDayBinding.bind(view).dayText
}

binding.payDatesCalendarView.dayBinder = object: DayBinder<DayViewContainer>{
override fun bind(container: DayViewContainer, day: CalendarDay) {
container.day = day
binding.payDatesCalendarView.dayBinder = object: MonthDayBinder<DayViewContainer>{
override fun bind(container: DayViewContainer, data: CalendarDay) {
container.day = data
val textView = container.onDayText
textView.text = day.date.dayOfMonth.toString()
if (day.owner == DayOwner.THIS_MONTH) {
textView.text = data.date.dayOfMonth.toString()
if (data.position == DayPosition.MonthDate) {
if (selectedPayDays.isNotEmpty()){
selectedPayDays.forEach { data ->
if(data == day.date){
selectedPayDays.forEach { day ->
if(day == data.date){
textView.setBackgroundColor(getCompatColor(R.color.md_red_400))
} else {
textView.setTextColor(setDayNightTheme())
Expand Down Expand Up @@ -208,21 +208,21 @@ class BillDetailsFragment: BaseDetailFragment() {
}
}

binding.paidDatesCalendarView.dayBinder = object: DayBinder<DayViewContainer>{
override fun bind(container: DayViewContainer, day: CalendarDay) {
container.day = day
binding.paidDatesCalendarView.dayBinder = object: MonthDayBinder<DayViewContainer>{
override fun bind(container: DayViewContainer, data: CalendarDay) {
container.day = data
val textView = container.onDayText
val divider = container.legendDivider
textView.text = day.date.dayOfMonth.toString()
if (day.owner == DayOwner.THIS_MONTH) {
textView.text = data.date.dayOfMonth.toString()
if (data.position == DayPosition.MonthDate) {
if (selectedPaidDays.isNotEmpty()){
selectedPaidDays.forEach { data ->
if(data == day.date){
selectedPaidDays.forEach { day ->
if(day == data.date){
divider.setBackgroundColor(getCompatColor(R.color.md_green_500))
}
}
}
if(selectedDate == day.date){
if(selectedDate == data.date){
textView.setBackgroundColor(getCompatColor(R.color.md_green_500))
}
textView.setTextColor(setDayNightTheme())
Expand Down Expand Up @@ -251,7 +251,7 @@ class BillDetailsFragment: BaseDetailFragment() {
calendarView.setup(startMonth, endMonth,
WeekFields.of(Locale.getDefault()).firstDayOfWeek)
calendarView.scrollToMonth(currentMonth)
calendarView.updateMonthConfiguration()
calendarView.updateMonthData()
}

private fun progressCircle(){
Expand Down
Loading