-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Release v1.1.0
- Loading branch information
Showing
82 changed files
with
1,179 additions
and
504 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ build/ | |
|
||
# Local configuration | ||
local.properties | ||
gradle.properties | ||
|
||
# IntelliJ | ||
*.iml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
app/src/main/java/org/fossasia/badgemagic/BadgeMagicApp.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package org.fossasia.badgemagic | ||
|
||
import android.app.Application | ||
import android.content.Context | ||
import android.content.res.Configuration | ||
import org.fossasia.badgemagic.di.singletonModules | ||
import org.fossasia.badgemagic.di.utilModules | ||
import org.fossasia.badgemagic.di.viewModelModules | ||
import org.fossasia.badgemagic.util.LocaleManager | ||
import org.koin.android.ext.koin.androidContext | ||
import org.koin.android.ext.koin.androidLogger | ||
import org.koin.core.context.startKoin | ||
import timber.log.Timber | ||
|
||
class BadgeMagicApp : Application() { | ||
|
||
companion object { | ||
@JvmStatic | ||
var appContext: Context? = null | ||
private set | ||
} | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
appContext = applicationContext | ||
|
||
startKoin { | ||
androidLogger() | ||
androidContext(applicationContext) | ||
modules(listOf( | ||
singletonModules, | ||
utilModules, | ||
viewModelModules | ||
)) | ||
} | ||
|
||
initLogger() | ||
} | ||
|
||
private fun initLogger() { | ||
if (BuildConfig.DEBUG) { | ||
Timber.plant(Timber.DebugTree()) | ||
} | ||
} | ||
|
||
override fun attachBaseContext(base: Context?) { | ||
super.attachBaseContext(LocaleManager.setLocale(base)) | ||
} | ||
|
||
override fun onConfigurationChanged(newConfig: Configuration) { | ||
super.onConfigurationChanged(newConfig) | ||
LocaleManager.setLocale(this) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 7 additions & 14 deletions
21
app/src/main/java/org/fossasia/badgemagic/adapter/ModeItemHolder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
app/src/main/java/org/fossasia/badgemagic/bindings/DrawViewBindings.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.fossasia.badgemagic.bindings | ||
|
||
import android.widget.ImageView | ||
import androidx.databinding.BindingAdapter | ||
import androidx.databinding.ObservableBoolean | ||
import androidx.databinding.ObservableField | ||
import org.fossasia.badgemagic.R | ||
import org.fossasia.badgemagic.data.draw_layout.DrawMode | ||
import org.fossasia.badgemagic.ui.custom.DrawBadgeLayout | ||
|
||
@BindingAdapter("drawState") | ||
fun setBadgeDrawState(badge: DrawBadgeLayout, drawModeState: ObservableField<DrawMode>) { | ||
drawModeState.get()?.let { badge.changeDrawState(it) } | ||
} | ||
|
||
@BindingAdapter("resetState") | ||
fun resetDrawBadge(badge: DrawBadgeLayout, isEnabled: ObservableBoolean) { | ||
badge.resetCheckList() | ||
} | ||
|
||
@BindingAdapter("changeColor") | ||
fun changeColorState(imageView: ImageView, isEnabled: ObservableBoolean) { | ||
imageView.setColorFilter( | ||
if (isEnabled.get()) | ||
imageView.context.resources.getColor(R.color.colorAccent) | ||
else | ||
imageView.context.resources.getColor(android.R.color.black) | ||
) | ||
} |
23 changes: 23 additions & 0 deletions
23
app/src/main/java/org/fossasia/badgemagic/bindings/SettingsViewBindings.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.fossasia.badgemagic.bindings | ||
|
||
import android.view.View | ||
import android.widget.AdapterView | ||
import android.widget.ArrayAdapter | ||
import androidx.appcompat.widget.AppCompatSpinner | ||
import androidx.databinding.BindingAdapter | ||
import org.fossasia.badgemagic.viewmodels.SettingsViewModel | ||
|
||
@BindingAdapter("createAdapterFrom") | ||
fun setSpinnerAdapter(spinner: AppCompatSpinner, viewModel: SettingsViewModel) { | ||
val list: MutableList<String> = viewModel.languageList.get() ?: mutableListOf() | ||
spinner.adapter = ArrayAdapter<String>(spinner.context, android.R.layout.simple_spinner_dropdown_item, list) | ||
spinner.setSelection(viewModel.getSelectedSpinnerLanguage(), false) | ||
spinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { | ||
override fun onNothingSelected(parent: AdapterView<*>?) { | ||
} | ||
|
||
override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { | ||
viewModel.setSelectedSpinnerLangauge(position) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.fossasia.badgemagic.data | ||
|
||
import java.util.Locale | ||
|
||
enum class Language(val locale: Locale) { | ||
ENGLISH(Locale.ENGLISH), | ||
CHINESE(Locale.CHINA), | ||
} |
18 changes: 0 additions & 18 deletions
18
app/src/main/java/org/fossasia/badgemagic/data/clipart/ClipArtContainer.kt
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
app/src/main/java/org/fossasia/badgemagic/data/clipart/ClipArtRepository.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
app/src/main/java/org/fossasia/badgemagic/data/draw_layout/DrawMode.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.fossasia.badgemagic.data.draw_layout | ||
|
||
enum class DrawMode(val mode: Int) { | ||
NOTHING(0), | ||
DRAW(1), | ||
ERASE(2) | ||
} |
Oops, something went wrong.