From a6e97a1b363d73ce1635993df0d05a39f263b53e Mon Sep 17 00:00:00 2001 From: M M Arif Date: Sun, 29 Nov 2020 22:51:35 +0100 Subject: [PATCH] Add new theme - Pitch Black (#787) update drawables Add new theme - Pitch Black Co-authored-by: M M Arif Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/787 Reviewed-by: 6543 <6543@noreply.codeberg.org> --- .../mian/gitnex/activities/BaseActivity.java | 27 +++++--- .../SettingsAppearanceActivity.java | 2 +- .../mian/gitnex/fragments/IssuesFragment.java | 3 + .../gitnex/fragments/MilestonesFragment.java | 3 + .../fragments/SearchIssuesFragment.java | 3 + .../res/layout/bottom_sheet_admin_users.xml | 5 +- .../main/res/layout/bottom_sheet_drafts.xml | 5 +- .../res/layout/bottom_sheet_file_viewer.xml | 13 ++-- .../res/layout/bottom_sheet_issues_filter.xml | 9 +-- .../layout/bottom_sheet_labels_in_list.xml | 9 +-- .../layout/bottom_sheet_milestones_filter.xml | 9 +-- .../bottom_sheet_milestones_in_list.xml | 9 +-- .../res/layout/bottom_sheet_notifications.xml | 15 ++--- .../bottom_sheet_notifications_filter.xml | 9 +-- .../res/layout/bottom_sheet_organization.xml | 13 ++-- .../bottom_sheet_organization_teams.xml | 5 +- .../main/res/layout/bottom_sheet_profile.xml | 5 +- .../bottom_sheet_pull_request_filter.xml | 9 +-- app/src/main/res/layout/bottom_sheet_repo.xml | 61 +++++++++--------- .../bottom_sheet_repository_in_list.xml | 21 ++++--- .../res/layout/bottom_sheet_single_issue.xml | 45 +++++++------- .../res/layout/fragment_administration.xml | 10 +-- app/src/main/res/layout/list_issues.xml | 7 --- app/src/main/res/layout/list_milestones.xml | 7 --- app/src/main/res/layout/list_pr.xml | 5 +- app/src/main/res/values/colors.xml | 4 +- app/src/main/res/values/themes.xml | 62 +++++++++++++++++++ 27 files changed, 229 insertions(+), 146 deletions(-) diff --git a/app/src/main/java/org/mian/gitnex/activities/BaseActivity.java b/app/src/main/java/org/mian/gitnex/activities/BaseActivity.java index 4ddf036b..4fb677d0 100644 --- a/app/src/main/java/org/mian/gitnex/activities/BaseActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/BaseActivity.java @@ -50,36 +50,47 @@ public abstract class BaseActivity extends AppCompatActivity { switch(tinyDB.getInt("themeId")) { case 1: + tinyDB.putString("currentTheme", "light"); setTheme(R.style.AppThemeLight); break; - case 2: + if(TimeHelper.timeBetweenHours(18, 6)) { // 6pm to 6am + tinyDB.putString("currentTheme", "dark"); setTheme(R.style.AppTheme); - } else { + } + else { + tinyDB.putString("currentTheme", "light"); setTheme(R.style.AppThemeLight); } break; - case 3: + tinyDB.putString("currentTheme", "light"); setTheme(R.style.AppThemeRetro); break; - case 4: if(TimeHelper.timeBetweenHours(18, 6)) { // 6pm to 6am + tinyDB.putString("currentTheme", "dark"); setTheme(R.style.AppTheme); - } else { + } + else { + tinyDB.putString("currentTheme", "light"); setTheme(R.style.AppThemeRetro); } break; + case 5: + tinyDB.putString("currentTheme", "dark"); + setTheme(R.style.AppThemePitchBlack); + break; default: + tinyDB.putString("currentTheme", "dark"); setTheme(R.style.AppTheme); @@ -95,25 +106,25 @@ public abstract class BaseActivity extends AppCompatActivity { switch(tinyDB.getInt("customFontId", -1)) { case 0: + FontsOverride.setDefaultFont(this, "DEFAULT", "fonts/roboto.ttf"); FontsOverride.setDefaultFont(this, "MONOSPACE", "fonts/roboto.ttf"); FontsOverride.setDefaultFont(this, "SERIF", "fonts/roboto.ttf"); FontsOverride.setDefaultFont(this, "SANS_SERIF", "fonts/roboto.ttf"); break; - case 2: + FontsOverride.setDefaultFont(this, "DEFAULT", "fonts/sourcecodeproregular.ttf"); FontsOverride.setDefaultFont(this, "MONOSPACE", "fonts/sourcecodeproregular.ttf"); FontsOverride.setDefaultFont(this, "SERIF", "fonts/sourcecodeproregular.ttf"); FontsOverride.setDefaultFont(this, "SANS_SERIF", "fonts/sourcecodeproregular.ttf"); break; - default: + FontsOverride.setDefaultFont(this, "DEFAULT", "fonts/manroperegular.ttf"); FontsOverride.setDefaultFont(this, "MONOSPACE", "fonts/manroperegular.ttf"); FontsOverride.setDefaultFont(this, "SERIF", "fonts/manroperegular.ttf"); FontsOverride.setDefaultFont(this, "SANS_SERIF", "fonts/manroperegular.ttf"); - } if(tinyDB.getInt("pollingDelayMinutes", 0) <= 0) { diff --git a/app/src/main/java/org/mian/gitnex/activities/SettingsAppearanceActivity.java b/app/src/main/java/org/mian/gitnex/activities/SettingsAppearanceActivity.java index a55108ac..95b54ec1 100644 --- a/app/src/main/java/org/mian/gitnex/activities/SettingsAppearanceActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/SettingsAppearanceActivity.java @@ -24,7 +24,7 @@ public class SettingsAppearanceActivity extends BaseActivity { private static final String[] customFontList = {"Roboto", "Manrope", "Source Code Pro"}; private static int customFontSelectedChoice = 0; - private static final String[] themeList = {"Dark", "Light", "Auto (Light / Dark)", "Retro", "Auto (Retro / Dark)"}; + private static final String[] themeList = {"Dark", "Light", "Auto (Light / Dark)", "Retro", "Auto (Retro / Dark)", "Pitch Black"}; private static int themeSelectedChoice = 0; @Override diff --git a/app/src/main/java/org/mian/gitnex/fragments/IssuesFragment.java b/app/src/main/java/org/mian/gitnex/fragments/IssuesFragment.java index 2941f4c8..1655d101 100644 --- a/app/src/main/java/org/mian/gitnex/fragments/IssuesFragment.java +++ b/app/src/main/java/org/mian/gitnex/fragments/IssuesFragment.java @@ -17,6 +17,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; @@ -105,7 +106,9 @@ public class IssuesFragment extends Fragment { })); + DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration.VERTICAL); recyclerView.setHasFixedSize(true); + recyclerView.addItemDecoration(dividerItemDecoration); recyclerView.setLayoutManager(new LinearLayoutManager(context)); recyclerView.setAdapter(adapter); diff --git a/app/src/main/java/org/mian/gitnex/fragments/MilestonesFragment.java b/app/src/main/java/org/mian/gitnex/fragments/MilestonesFragment.java index 2e76d471..b1a0d9d2 100644 --- a/app/src/main/java/org/mian/gitnex/fragments/MilestonesFragment.java +++ b/app/src/main/java/org/mian/gitnex/fragments/MilestonesFragment.java @@ -14,6 +14,7 @@ import android.view.ViewGroup; import android.view.inputmethod.EditorInfo; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import org.mian.gitnex.R; import org.mian.gitnex.activities.RepoDetailActivity; @@ -88,6 +89,8 @@ public class MilestonesFragment extends Fragment { } + DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(viewBinding.recyclerView.getContext(), DividerItemDecoration.VERTICAL); + viewBinding.recyclerView.addItemDecoration(dividerItemDecoration); viewBinding.recyclerView.setHasFixedSize(true); viewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx)); viewBinding.recyclerView.setAdapter(adapter); diff --git a/app/src/main/java/org/mian/gitnex/fragments/SearchIssuesFragment.java b/app/src/main/java/org/mian/gitnex/fragments/SearchIssuesFragment.java index ace7a0b3..e31c977e 100644 --- a/app/src/main/java/org/mian/gitnex/fragments/SearchIssuesFragment.java +++ b/app/src/main/java/org/mian/gitnex/fragments/SearchIssuesFragment.java @@ -10,6 +10,7 @@ import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodManager; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; +import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import org.mian.gitnex.adapters.SearchIssuesAdapter; import org.mian.gitnex.clients.RetrofitClient; @@ -57,6 +58,8 @@ public class SearchIssuesFragment extends Fragment { LinearLayoutManager linearLayoutManager = new LinearLayoutManager(ctx); + DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(viewBinding.recyclerViewSearchIssues.getContext(), DividerItemDecoration.VERTICAL); + viewBinding.recyclerViewSearchIssues.addItemDecoration(dividerItemDecoration); viewBinding.recyclerViewSearchIssues.setHasFixedSize(true); viewBinding.recyclerViewSearchIssues.setLayoutManager(linearLayoutManager); viewBinding.recyclerViewSearchIssues.setAdapter(adapter); diff --git a/app/src/main/res/layout/bottom_sheet_admin_users.xml b/app/src/main/res/layout/bottom_sheet_admin_users.xml index 03c45404..18d79744 100644 --- a/app/src/main/res/layout/bottom_sheet_admin_users.xml +++ b/app/src/main/res/layout/bottom_sheet_admin_users.xml @@ -1,6 +1,7 @@ + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_person_add" /> diff --git a/app/src/main/res/layout/bottom_sheet_drafts.xml b/app/src/main/res/layout/bottom_sheet_drafts.xml index 3ba8e465..4d76f557 100644 --- a/app/src/main/res/layout/bottom_sheet_drafts.xml +++ b/app/src/main/res/layout/bottom_sheet_drafts.xml @@ -1,6 +1,7 @@ + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_delete" /> diff --git a/app/src/main/res/layout/bottom_sheet_file_viewer.xml b/app/src/main/res/layout/bottom_sheet_file_viewer.xml index 71352dea..30cbcd48 100644 --- a/app/src/main/res/layout/bottom_sheet_file_viewer.xml +++ b/app/src/main/res/layout/bottom_sheet_file_viewer.xml @@ -1,6 +1,7 @@ + android:textSize="16sp" + app:drawableStartCompat="@drawable/ic_edit" /> + android:textSize="16sp" + app:drawableStartCompat="@drawable/ic_delete" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_download" /> diff --git a/app/src/main/res/layout/bottom_sheet_issues_filter.xml b/app/src/main/res/layout/bottom_sheet_issues_filter.xml index 4ae9e66e..a89de021 100644 --- a/app/src/main/res/layout/bottom_sheet_issues_filter.xml +++ b/app/src/main/res/layout/bottom_sheet_issues_filter.xml @@ -1,6 +1,7 @@ + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_issue" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_done" /> diff --git a/app/src/main/res/layout/bottom_sheet_labels_in_list.xml b/app/src/main/res/layout/bottom_sheet_labels_in_list.xml index b94193ee..e9e78677 100644 --- a/app/src/main/res/layout/bottom_sheet_labels_in_list.xml +++ b/app/src/main/res/layout/bottom_sheet_labels_in_list.xml @@ -1,6 +1,7 @@ + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_edit" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_delete" /> diff --git a/app/src/main/res/layout/bottom_sheet_milestones_filter.xml b/app/src/main/res/layout/bottom_sheet_milestones_filter.xml index 3bbc112a..d876482f 100644 --- a/app/src/main/res/layout/bottom_sheet_milestones_filter.xml +++ b/app/src/main/res/layout/bottom_sheet_milestones_filter.xml @@ -1,6 +1,7 @@ + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_milestone" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_done" /> diff --git a/app/src/main/res/layout/bottom_sheet_milestones_in_list.xml b/app/src/main/res/layout/bottom_sheet_milestones_in_list.xml index 8ca9d814..8acacdfb 100644 --- a/app/src/main/res/layout/bottom_sheet_milestones_in_list.xml +++ b/app/src/main/res/layout/bottom_sheet_milestones_in_list.xml @@ -1,6 +1,7 @@ + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_close" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_check" /> diff --git a/app/src/main/res/layout/bottom_sheet_notifications.xml b/app/src/main/res/layout/bottom_sheet_notifications.xml index 18f38130..f22ab13f 100644 --- a/app/src/main/res/layout/bottom_sheet_notifications.xml +++ b/app/src/main/res/layout/bottom_sheet_notifications.xml @@ -1,7 +1,8 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/pinNotification" - android:drawableStart="@drawable/ic_pin" android:drawablePadding="24dp" android:textColor="?attr/primaryTextColor" android:textSize="16sp" - android:padding="12dp" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_pin" /> android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/markAsRead" - android:drawableStart="@drawable/ic_unwatch" android:drawablePadding="24dp" android:textColor="?attr/primaryTextColor" android:textSize="16sp" - android:padding="12dp" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_unwatch" /> android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/markAsUnread" - android:drawableStart="@drawable/ic_watchers" android:drawablePadding="24dp" android:textColor="?attr/primaryTextColor" android:textSize="16sp" - android:padding="12dp" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_watchers" /> diff --git a/app/src/main/res/layout/bottom_sheet_notifications_filter.xml b/app/src/main/res/layout/bottom_sheet_notifications_filter.xml index 54969a3e..2ac0a503 100644 --- a/app/src/main/res/layout/bottom_sheet_notifications_filter.xml +++ b/app/src/main/res/layout/bottom_sheet_notifications_filter.xml @@ -1,6 +1,7 @@ + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_watchers" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_unwatch" /> diff --git a/app/src/main/res/layout/bottom_sheet_organization.xml b/app/src/main/res/layout/bottom_sheet_organization.xml index e6d6d46a..2d6841b3 100644 --- a/app/src/main/res/layout/bottom_sheet_organization.xml +++ b/app/src/main/res/layout/bottom_sheet_organization.xml @@ -1,6 +1,7 @@ + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_repo" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_people" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_copy" /> diff --git a/app/src/main/res/layout/bottom_sheet_organization_teams.xml b/app/src/main/res/layout/bottom_sheet_organization_teams.xml index a4accfa8..003f7f2e 100644 --- a/app/src/main/res/layout/bottom_sheet_organization_teams.xml +++ b/app/src/main/res/layout/bottom_sheet_organization_teams.xml @@ -1,6 +1,7 @@ + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_person_add" /> diff --git a/app/src/main/res/layout/bottom_sheet_profile.xml b/app/src/main/res/layout/bottom_sheet_profile.xml index 92f6d504..27d7ba80 100644 --- a/app/src/main/res/layout/bottom_sheet_profile.xml +++ b/app/src/main/res/layout/bottom_sheet_profile.xml @@ -1,6 +1,7 @@ + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_email" /> diff --git a/app/src/main/res/layout/bottom_sheet_pull_request_filter.xml b/app/src/main/res/layout/bottom_sheet_pull_request_filter.xml index 6f1d7f07..10c06915 100644 --- a/app/src/main/res/layout/bottom_sheet_pull_request_filter.xml +++ b/app/src/main/res/layout/bottom_sheet_pull_request_filter.xml @@ -1,6 +1,7 @@ + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_pull_request" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_done" /> diff --git a/app/src/main/res/layout/bottom_sheet_repo.xml b/app/src/main/res/layout/bottom_sheet_repo.xml index b0767268..0b50ed57 100644 --- a/app/src/main/res/layout/bottom_sheet_repo.xml +++ b/app/src/main/res/layout/bottom_sheet_repo.xml @@ -1,6 +1,7 @@ + android:textSize="16sp" + app:drawableStartCompat="@drawable/ic_file" /> + android:textSize="16sp" + app:drawableStartCompat="@drawable/ic_issue" /> + android:textSize="16sp" + app:drawableStartCompat="@drawable/ic_pull_request" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_milestone" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_label" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_release" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_person_add" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_star_unfilled" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_star" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_unwatch" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_watchers" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_copy" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_share" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_browser" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_settings" /> diff --git a/app/src/main/res/layout/bottom_sheet_repository_in_list.xml b/app/src/main/res/layout/bottom_sheet_repository_in_list.xml index 30fbc702..bd3ddd38 100644 --- a/app/src/main/res/layout/bottom_sheet_repository_in_list.xml +++ b/app/src/main/res/layout/bottom_sheet_repository_in_list.xml @@ -1,6 +1,7 @@ + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_star_unfilled" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_unwatch" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_fork" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_copy" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_browser" /> diff --git a/app/src/main/res/layout/bottom_sheet_single_issue.xml b/app/src/main/res/layout/bottom_sheet_single_issue.xml index 7d414109..be79900d 100644 --- a/app/src/main/res/layout/bottom_sheet_single_issue.xml +++ b/app/src/main/res/layout/bottom_sheet_single_issue.xml @@ -1,6 +1,7 @@ + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_file" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_pull_request" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_edit" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_person_add" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_label" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_unwatch" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_watchers" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_share" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_copy" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_issue_closed" /> + android:padding="12dp" + app:drawableStartCompat="@drawable/ic_reopen" /> diff --git a/app/src/main/res/layout/fragment_administration.xml b/app/src/main/res/layout/fragment_administration.xml index fa497b2b..9c810f13 100644 --- a/app/src/main/res/layout/fragment_administration.xml +++ b/app/src/main/res/layout/fragment_administration.xml @@ -1,5 +1,6 @@ @@ -19,16 +20,11 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:text="@string/adminUsers" - android:drawableStart="@drawable/ic_people" android:drawablePadding="32dp" android:textColor="?attr/primaryTextColor" android:textSize="16sp" - android:padding="16dp" /> - - + android:padding="16dp" + app:drawableStartCompat="@drawable/ic_people" /> diff --git a/app/src/main/res/layout/list_issues.xml b/app/src/main/res/layout/list_issues.xml index 2aba3e50..8d4faff7 100644 --- a/app/src/main/res/layout/list_issues.xml +++ b/app/src/main/res/layout/list_issues.xml @@ -102,11 +102,4 @@ - - diff --git a/app/src/main/res/layout/list_milestones.xml b/app/src/main/res/layout/list_milestones.xml index dea28142..313e59e3 100644 --- a/app/src/main/res/layout/list_milestones.xml +++ b/app/src/main/res/layout/list_milestones.xml @@ -178,11 +178,4 @@ - - diff --git a/app/src/main/res/layout/list_pr.xml b/app/src/main/res/layout/list_pr.xml index 5e049754..a62e94a6 100644 --- a/app/src/main/res/layout/list_pr.xml +++ b/app/src/main/res/layout/list_pr.xml @@ -1,6 +1,7 @@ + android:textSize="14sp" + app:drawableStartCompat="@drawable/ic_comment" /> diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index b024bc12..3a85e05f 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -1,6 +1,5 @@ - #212121 #212121 #7f7e7b @@ -56,4 +55,7 @@ #a333c8 #db2828 + #050505 + #d2d2d2 + #151515 diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 0ae51044..a2af303a 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -121,6 +121,46 @@ + + + + + + + + + +