Skip to content
This repository was archived by the owner on Nov 18, 2024. It is now read-only.

Commit 6086642

Browse files
committed
Merge dev branch
2 parents aff5afe + 1052ae2 commit 6086642

97 files changed

Lines changed: 1325 additions & 403 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
0 Bytes
Binary file not shown.

.idea/misc.xml

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ If you have any questions — welcome to the [FAQs page](FAQs.md)!
2222
## Next update changes (v1.6):
2323
- [x] Continue redesign (BottomAppBar, rounded dialogs)
2424
- [x] Add adaptive icon
25-
- [ ] Add dark theme
25+
- [x] Add dark theme
2626
- [x] Add shortcuts
2727

2828
## Download links:

app/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ android {
3333
dependencies {
3434
// UI
3535
implementation "androidx.appcompat:appcompat:$rootProject.appcompatVersion"
36-
implementation "com.google.android.material:material:$rootProject.androidxVersion"
36+
implementation "com.google.android.material:material:$rootProject.materialVersion"
3737
implementation "androidx.cardview:cardview:$rootProject.androidxVersion"
3838
implementation "androidx.preference:preference:$rootProject.androidxVersion"
3939
implementation "com.github.XunMengWinter:CircularAnim:$rootProject.circularAnimVersion"
40+
implementation "com.github.Daio-io:dresscode:$rootProject.dresscodeVersion"
4041
implementation "androidx.constraintlayout:constraintlayout:$rootProject.constraintLayoutVersion"
4142

4243
// Firebase Crashlytics

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
77

88
<application
9+
android:name=".ui.App"
910
android:allowBackup="true"
1011
android:icon="@mipmap/ic_launcher"
1112
android:label="@string/app_name"
1213
android:supportsRtl="true"
13-
android:theme="@style/AppTheme">
14+
android:theme="@style/AppTheme.Light">
1415
<activity
1516
android:name=".ui.view.MainActivity"
1617
android:launchMode="singleTop"
@@ -30,7 +31,7 @@
3031
android:screenOrientation="portrait"
3132
android:windowSoftInputMode="adjustResize" />
3233
<activity
33-
android:name="apps.jizzu.simpletodo.ui.view.settings.activity.SettingsActivity"
34+
android:name=".ui.view.settings.activity.SettingsActivity"
3435
android:screenOrientation="portrait" />
3536
<activity
3637
android:name=".ui.view.ChangelogActivity"

app/src/main/java/apps/jizzu/simpletodo/service/alarm/AlarmReceiver.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class AlarmReceiver : BroadcastReceiver() {
4444
setContentTitle(context.getString(R.string.reminder_text))
4545
setContentText(title)
4646
setStyle(NotificationCompat.BigTextStyle().bigText(title))
47-
color = ContextCompat.getColor(context, R.color.colorAccent)
47+
color = ContextCompat.getColor(context, R.color.blue)
4848
setSmallIcon(R.drawable.ic_check_circle_white_24dp)
4949
setDefaults(Notification.DEFAULT_ALL)
5050
setContentIntent(pendingIntent)

app/src/main/java/apps/jizzu/simpletodo/service/widget/ViewFactory.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ViewFactory internal constructor(private val mContext: Context) : RemoteVi
4444
// Today
4545
DateUtils.isToday(mWidgetData[position].date) -> {
4646
remoteViews.apply {
47-
setTextColor(R.id.item_date, ContextCompat.getColor(mContext, R.color.colorPrimary))
47+
setTextColor(R.id.item_date, ContextCompat.getColor(mContext, R.color.blue))
4848
setTextViewText(R.id.item_date, mContext.getString(R.string.reminder_today, DateAndTimeFormatter.getTime(mWidgetData[position].date)))
4949
}
5050
}
@@ -60,7 +60,7 @@ class ViewFactory internal constructor(private val mContext: Context) : RemoteVi
6060
// Tomorrow
6161
DateUtils.isToday(mWidgetData[position].date - DateUtils.DAY_IN_MILLIS) -> {
6262
remoteViews.apply {
63-
setTextColor(R.id.item_date, ContextCompat.getColor(mContext, R.color.colorPrimary))
63+
setTextColor(R.id.item_date, ContextCompat.getColor(mContext, R.color.blue))
6464
setTextViewText(R.id.item_date, mContext.getString(R.string.reminder_tomorrow, DateAndTimeFormatter.getTime(mWidgetData[position].date)))
6565
}
6666
}
@@ -76,7 +76,7 @@ class ViewFactory internal constructor(private val mContext: Context) : RemoteVi
7676
// Far future
7777
else -> {
7878
remoteViews.apply {
79-
setTextColor(R.id.item_date, ContextCompat.getColor(mContext, R.color.colorPrimary))
79+
setTextColor(R.id.item_date, ContextCompat.getColor(mContext, R.color.blue))
8080
setTextViewText(R.id.item_date, mContext.getString(R.string.date_format_at, DateAndTimeFormatter.getFullDate(mWidgetData[position].date), DateAndTimeFormatter.getTime(mWidgetData[position].date)))
8181
}
8282
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package apps.jizzu.simpletodo.ui
2+
3+
import android.app.Application
4+
import apps.jizzu.simpletodo.R
5+
import daio.io.dresscode.DressCode
6+
import daio.io.dresscode.declareDressCode
7+
8+
class App : Application() {
9+
10+
override fun onCreate() {
11+
super.onCreate()
12+
13+
declareDressCode(
14+
DressCode("Light", R.style.AppTheme_Light),
15+
DressCode("Dark", R.style.AppTheme_Dark),
16+
DressCode("Black", R.style.AppTheme_Black)
17+
)
18+
}
19+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package apps.jizzu.simpletodo.ui.dialogs
2+
3+
import android.app.Application
4+
import android.os.Bundle
5+
import android.view.LayoutInflater
6+
import android.view.View
7+
import android.view.ViewGroup
8+
import androidx.lifecycle.ViewModelProviders
9+
import apps.jizzu.simpletodo.R
10+
import apps.jizzu.simpletodo.ui.dialogs.base.BaseDialogFragment
11+
import apps.jizzu.simpletodo.utils.toast
12+
import apps.jizzu.simpletodo.vm.CreateBackupViewModel
13+
import kotlinx.android.synthetic.main.dialog_default.*
14+
15+
class CreateBackupDialogFragment : BaseDialogFragment() {
16+
private lateinit var mViewModel: CreateBackupViewModel
17+
18+
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? =
19+
inflater.inflate(R.layout.dialog_default, container, false)
20+
21+
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
22+
super.onViewCreated(view, savedInstanceState)
23+
activity?.let { mViewModel = createViewModel(it.application) }
24+
initDialog()
25+
}
26+
27+
private fun initDialog() {
28+
dialogMessage.setText(R.string.backup_create_dialog_message)
29+
buttonConfirm.setText(R.string.backup_create_dialog_button)
30+
buttonConfirm.setOnClickListener { createBackup() }
31+
buttonCancel.setOnClickListener { dismiss() }
32+
}
33+
34+
private fun createBackup() {
35+
mViewModel.createBackup()
36+
37+
if (mViewModel.isBackupCreatedSuccessfully()) {
38+
dismiss()
39+
toast(getString(R.string.backup_create_message_success))
40+
} else {
41+
dismiss()
42+
toast(getString(R.string.backup_create_message_failure))
43+
}
44+
}
45+
46+
private fun createViewModel(application: Application) = ViewModelProviders.of(this).get(CreateBackupViewModel(application)::class.java)
47+
}

0 commit comments

Comments
 (0)