diff --git a/app/src/main/java/org/secuso/privacyfriendlynotes/ui/adapter/NoteAdapter.java b/app/src/main/java/org/secuso/privacyfriendlynotes/ui/adapter/NoteAdapter.java index 7488fcc0..8614c1ea 100644 --- a/app/src/main/java/org/secuso/privacyfriendlynotes/ui/adapter/NoteAdapter.java +++ b/app/src/main/java/org/secuso/privacyfriendlynotes/ui/adapter/NoteAdapter.java @@ -71,18 +71,18 @@ public void onBindViewHolder(@NonNull NoteHolder holder, int position) { switch (currentNote.getType()) { case DbContract.NoteEntry.TYPE_TEXT: - holder.imageViewcategory.setImageResource(R.drawable.ic_short_text_black_24dp); + holder.imageViewcategory.setImageResource(R.drawable.ic_short_text_icon_24dp); holder.textViewDescription.setText(Html.fromHtml(currentNote.getContent())); holder.textViewDescription.setMaxLines(3); break; case DbContract.NoteEntry.TYPE_AUDIO: - holder.imageViewcategory.setImageResource(R.drawable.ic_mic_black_24dp); + holder.imageViewcategory.setImageResource(R.drawable.ic_mic_icon_24dp); break; case DbContract.NoteEntry.TYPE_SKETCH: - holder.imageViewcategory.setImageResource(R.drawable.ic_photo_black_24dp); + holder.imageViewcategory.setImageResource(R.drawable.ic_photo_icon_24dp); break; case DbContract.NoteEntry.TYPE_CHECKLIST: - holder.imageViewcategory.setImageResource(R.drawable.ic_format_list_bulleted_black_24dp); + holder.imageViewcategory.setImageResource(R.drawable.ic_format_list_bulleted_icon_24dp); String preview = ""; try { JSONArray content = new JSONArray(currentNote.getContent()); diff --git a/app/src/main/java/org/secuso/privacyfriendlynotes/ui/fragments/SettingsFragment.java b/app/src/main/java/org/secuso/privacyfriendlynotes/ui/fragments/SettingsFragment.kt similarity index 56% rename from app/src/main/java/org/secuso/privacyfriendlynotes/ui/fragments/SettingsFragment.java rename to app/src/main/java/org/secuso/privacyfriendlynotes/ui/fragments/SettingsFragment.kt index 3e1c1b02..c5c167b4 100644 --- a/app/src/main/java/org/secuso/privacyfriendlynotes/ui/fragments/SettingsFragment.java +++ b/app/src/main/java/org/secuso/privacyfriendlynotes/ui/fragments/SettingsFragment.kt @@ -11,20 +11,25 @@ You should have received a copy of the GNU General Public License along with Privacy Friendly Notes. If not, see . */ -package org.secuso.privacyfriendlynotes.ui.fragments; +package org.secuso.privacyfriendlynotes.ui.fragments -import android.os.Bundle; -import android.preference.PreferenceFragment; - -import org.secuso.privacyfriendlynotes.R; +import android.os.Bundle +import android.preference.PreferenceFragment +import androidx.appcompat.app.AppCompatDelegate +import org.secuso.privacyfriendlynotes.R /** * Fragment that provides the settings. * Created by Robin on 11.09.2016. */ -public class SettingsFragment extends PreferenceFragment { - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - addPreferencesFromResource(R.xml.pref_settings); +class SettingsFragment : PreferenceFragment() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + addPreferencesFromResource(R.xml.pref_settings) + findPreference("settings_day_night_theme")?.setOnPreferenceChangeListener { _, newValue -> + AppCompatDelegate.setDefaultNightMode(newValue.toString().toInt()) + true; + } + } } \ No newline at end of file diff --git a/app/src/main/java/org/secuso/privacyfriendlynotes/ui/main/MainActivity.java b/app/src/main/java/org/secuso/privacyfriendlynotes/ui/main/MainActivity.java index b735ddd9..899306dc 100644 --- a/app/src/main/java/org/secuso/privacyfriendlynotes/ui/main/MainActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlynotes/ui/main/MainActivity.java @@ -15,6 +15,7 @@ import android.app.Activity; import android.content.Intent; +import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.preference.PreferenceManager; import com.google.android.material.navigation.NavigationView; @@ -24,8 +25,10 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import android.util.Log; import android.widget.SearchView; +import androidx.appcompat.app.AppCompatDelegate; import androidx.arch.core.util.Function; import androidx.core.view.GravityCompat; import androidx.appcompat.app.ActionBarDrawerToggle; @@ -107,7 +110,7 @@ protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); - + getSupportActionBar().setStackedBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.colorPrimary))); //set the OnClickListeners findViewById(R.id.fab_text).setOnClickListener(this); findViewById(R.id.fab_checklist).setOnClickListener(this); @@ -208,6 +211,10 @@ public boolean onQueryTextSubmit(String query) { }); PreferenceManager.setDefaultValues(this, R.xml.pref_settings, false); + + String theme = PreferenceManager.getDefaultSharedPreferences(this).getString("settings_day_night_theme", "-1"); + Log.d("Theme", theme); + AppCompatDelegate.setDefaultNightMode(Integer.parseInt(theme)); } @Override diff --git a/app/src/main/java/org/secuso/privacyfriendlynotes/ui/notes/AudioNoteActivity.kt b/app/src/main/java/org/secuso/privacyfriendlynotes/ui/notes/AudioNoteActivity.kt index b0b73e0a..ef2d8d5d 100644 --- a/app/src/main/java/org/secuso/privacyfriendlynotes/ui/notes/AudioNoteActivity.kt +++ b/app/src/main/java/org/secuso/privacyfriendlynotes/ui/notes/AudioNoteActivity.kt @@ -254,9 +254,9 @@ class AudioNoteActivity : BaseNoteActivity(DbContract.NoteEntry.TYPE_AUDIO) { private fun togglePlayPauseButton() { if (playing) { - btnPlayPause.setBackgroundResource(R.drawable.ic_pause_black_24dp) + btnPlayPause.setBackgroundResource(R.drawable.ic_pause_icon_24dp) } else { - btnPlayPause.setBackgroundResource(R.drawable.ic_play_arrow_black_24dp) + btnPlayPause.setBackgroundResource(R.drawable.ic_play_arrow_icon_24dp) } } diff --git a/app/src/main/res/drawable/ic_format_list_bulleted_black_24dp.xml b/app/src/main/res/drawable/ic_format_list_bulleted_icon_24dp.xml similarity index 92% rename from app/src/main/res/drawable/ic_format_list_bulleted_black_24dp.xml rename to app/src/main/res/drawable/ic_format_list_bulleted_icon_24dp.xml index 5937a4eb..a2a187ec 100644 --- a/app/src/main/res/drawable/ic_format_list_bulleted_black_24dp.xml +++ b/app/src/main/res/drawable/ic_format_list_bulleted_icon_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/drawable/ic_mic_black_24dp.xml b/app/src/main/res/drawable/ic_mic_icon_24dp.xml similarity index 90% rename from app/src/main/res/drawable/ic_mic_black_24dp.xml rename to app/src/main/res/drawable/ic_mic_icon_24dp.xml index 4f0dc044..e6a2385b 100644 --- a/app/src/main/res/drawable/ic_mic_black_24dp.xml +++ b/app/src/main/res/drawable/ic_mic_icon_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/drawable/ic_pause_black_24dp.xml b/app/src/main/res/drawable/ic_pause_icon_24dp.xml similarity index 85% rename from app/src/main/res/drawable/ic_pause_black_24dp.xml rename to app/src/main/res/drawable/ic_pause_icon_24dp.xml index bb28a6c4..2a09bfd9 100644 --- a/app/src/main/res/drawable/ic_pause_black_24dp.xml +++ b/app/src/main/res/drawable/ic_pause_icon_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/drawable/ic_photo_black_24dp.xml b/app/src/main/res/drawable/ic_photo_icon_24dp.xml similarity index 88% rename from app/src/main/res/drawable/ic_photo_black_24dp.xml rename to app/src/main/res/drawable/ic_photo_icon_24dp.xml index b2018595..c3363c70 100644 --- a/app/src/main/res/drawable/ic_photo_black_24dp.xml +++ b/app/src/main/res/drawable/ic_photo_icon_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/drawable/ic_play_arrow_black_24dp.xml b/app/src/main/res/drawable/ic_play_arrow_icon_24dp.xml similarity index 84% rename from app/src/main/res/drawable/ic_play_arrow_black_24dp.xml rename to app/src/main/res/drawable/ic_play_arrow_icon_24dp.xml index bf9b895a..a34b479e 100644 --- a/app/src/main/res/drawable/ic_play_arrow_black_24dp.xml +++ b/app/src/main/res/drawable/ic_play_arrow_icon_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/drawable/ic_short_text_black_24dp.xml b/app/src/main/res/drawable/ic_short_text_icon_24dp.xml similarity index 85% rename from app/src/main/res/drawable/ic_short_text_black_24dp.xml rename to app/src/main/res/drawable/ic_short_text_icon_24dp.xml index 11c24c5a..c0ee7a03 100644 --- a/app/src/main/res/drawable/ic_short_text_black_24dp.xml +++ b/app/src/main/res/drawable/ic_short_text_icon_24dp.xml @@ -4,6 +4,6 @@ android:viewportWidth="24.0" android:viewportHeight="24.0"> diff --git a/app/src/main/res/drawable/secuso_logo_blau_blau.png b/app/src/main/res/drawable/secuso_logo_blau_blau.png deleted file mode 100644 index 9c82d7c8..00000000 Binary files a/app/src/main/res/drawable/secuso_logo_blau_blau.png and /dev/null differ diff --git a/app/src/main/res/drawable/secuso_logo_blau_blau.xml b/app/src/main/res/drawable/secuso_logo_blau_blau.xml new file mode 100644 index 00000000..1d9eee3f --- /dev/null +++ b/app/src/main/res/drawable/secuso_logo_blau_blau.xml @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-land/activity_audio_note.xml b/app/src/main/res/layout-land/activity_audio_note.xml index b9d6c341..38e4cc96 100644 --- a/app/src/main/res/layout-land/activity_audio_note.xml +++ b/app/src/main/res/layout-land/activity_audio_note.xml @@ -30,7 +30,7 @@ android:id="@+id/btn_play_pause" android:layout_width="48dp" android:layout_height="48dp" - android:background="@drawable/ic_play_arrow_black_24dp" + android:background="@drawable/ic_play_arrow_icon_24dp" android:padding="16dp" android:visibility="invisible" /> @@ -38,7 +38,7 @@ android:id="@+id/btn_record" android:layout_width="48dp" android:layout_height="48dp" - android:background="@drawable/ic_mic_black_24dp" + android:background="@drawable/ic_mic_icon_24dp" android:padding="16dp" /> diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 259b71b0..62754a4b 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -1,25 +1,25 @@ + android:background="?attr/colorSurface"> + tools:context=".ui.AboutActivity"> diff --git a/app/src/main/res/layout/activity_audio_note.xml b/app/src/main/res/layout/activity_audio_note.xml index 1158393f..36bb2b4b 100644 --- a/app/src/main/res/layout/activity_audio_note.xml +++ b/app/src/main/res/layout/activity_audio_note.xml @@ -1,6 +1,7 @@ + android:background="@drawable/ic_mic_icon_24dp" /> + android:background="@drawable/ic_play_arrow_icon_24dp"/> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 8e69e22f..bf3e097a 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -19,6 +19,7 @@ android:layout_height="match_parent" android:layout_gravity="start" android:fitsSystemWindows="true" + android:background="?attr/colorBackground" app:headerLayout="@layout/nav_header_main" app:menu="@menu/activity_main_drawer" /> diff --git a/app/src/main/res/layout/nav_header_main.xml b/app/src/main/res/layout/nav_header_main.xml index a514fb20..02a82dcd 100644 --- a/app/src/main/res/layout/nav_header_main.xml +++ b/app/src/main/res/layout/nav_header_main.xml @@ -2,37 +2,41 @@ + android:orientation="horizontal" + android:background="?attr/colorNavbarHeaderSurface" + android:paddingTop="7dp" + android:paddingBottom="7dp"> + android:layout_toRightOf="@id/imageView" + android:textColor="?attr/colorNavbarHeaderText" + android:textSize="18sp"/> diff --git a/app/src/main/res/layout/note_header.xml b/app/src/main/res/layout/note_header.xml index ae136e43..72853079 100644 --- a/app/src/main/res/layout/note_header.xml +++ b/app/src/main/res/layout/note_header.xml @@ -34,7 +34,9 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:inputType="none" - android:singleLine="true"/> + android:singleLine="true" + android:textColor="?attr/editTextColor" + /> \ No newline at end of file diff --git a/app/src/main/res/layout/note_item.xml b/app/src/main/res/layout/note_item.xml index 44176335..d0f1277d 100644 --- a/app/src/main/res/layout/note_item.xml +++ b/app/src/main/res/layout/note_item.xml @@ -4,18 +4,22 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp" - android:layout_marginHorizontal="@dimen/activity_horizontal_margin"> + android:layout_marginHorizontal="@dimen/activity_horizontal_margin" + app:cardBackgroundColor="?attr/colorSurface" + app:cardCornerRadius="8dp" + > + app:srcCompat="@drawable/ic_format_list_bulleted_icon_24dp" /> + android:textAppearance="@style/TextAppearance.AppCompat.Large" + /> \ No newline at end of file diff --git a/app/src/main/res/menu/activity_main_drawer.xml b/app/src/main/res/menu/activity_main_drawer.xml index aa8bd675..a0cbfec1 100644 --- a/app/src/main/res/menu/activity_main_drawer.xml +++ b/app/src/main/res/menu/activity_main_drawer.xml @@ -18,7 +18,7 @@ diff --git a/app/src/main/res/values-night/styles.xml b/app/src/main/res/values-night/styles.xml new file mode 100644 index 00000000..2876dcd9 --- /dev/null +++ b/app/src/main/res/values-night/styles.xml @@ -0,0 +1,21 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 6b46c5bb..b7dc397a 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -47,4 +47,10 @@ 30 + + -1 + 1 + 2 + + \ No newline at end of file diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml new file mode 100644 index 00000000..6b49c61d --- /dev/null +++ b/app/src/main/res/values/attrs.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index ef80205e..8e50f5b7 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -3,6 +3,12 @@ SecUSo colors: <--> #024265 #024265 + #FFFFFF + #373a3d + #FFFFFF + #050a0f + #FFFFFF + #222222 #0274B2 #00000000 #A8A8A8 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 82f783a3..2f51dd7b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -154,5 +154,11 @@ Formatting Note not saved + Design + + System + Light + Dark + diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 0ee66388..a4ad8780 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,13 +1,22 @@ -