diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 872427730..a563ca547 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,6 +54,14 @@ All branches should have distinct history and should be visually easy to follow, If you wish to rebase you should be following the [Golden Rule](https://www.atlassian.com/git/tutorials/merging-vs-rebasing#the-golden-rule-of-rebasing) and ahere to the advice in the heading [Aside: Rebase as cleanup is awesome in the coding lifecycle](https://www.atlassian.com/git/articles/git-team-workflows-merge-or-rebase). +### Design and style + +For an overview of how to make design changes to Kiwix Android, check out [DESIGN.md](https://github.com/kiwix/kiwix-android/edit/develop/DESIGN.md). + +### Adding new string resources + +To add a new string resource see [STRING_RESOURCES.md](https://github.com/kiwix/kiwix-android/edit/develop/STRING_RESOURCES.md). + ### Building The Kiwix app is split into 3 modules diff --git a/DESIGN.md b/DESIGN.md new file mode 100644 index 000000000..0990f5950 --- /dev/null +++ b/DESIGN.md @@ -0,0 +1,72 @@ +# Design + +This file intends to provide information on how to work with design in the Kiwix android applicaiton. + +## Colors + +drawing + +The Kiwix colors are black and white with different colored accents. For Kiwix Android, black is accented by different shades of blue: + +- ![#000000](https://via.placeholder.com/15/000000/000000?text=+) `#000000`/`black` +- ![#1565c0](https://via.placeholder.com/15/1565c0/000000?text=+) `#1565c0`/`denim_blue800` +- ![#42a5f5](https://via.placeholder.com/15/42a5f5/000000?text=+) `#42a5f5`/`denim_blue400` +- ![#2196F3](https://via.placeholder.com/15/2196F3/000000?text=+) `#2196F3`/`dodger_blue` + +> Color indicates which elements are interactive, how they relate to other elements, and their level of prominence. Important elements should stand out the most [1]. + +For a guide on how to apply colors to UI, see ["Applying color to UI - Material Design"](https://material.io/design/color/applying-color-to-ui.html#backdrop). + +## Themes +Kiwix uses themes to apply styles to views. This means that instead of adding a specific color or style to each view in the application, a theme should be set. +Themes are defined in `res/values/themes.xml` or `res/values-night/themes.xml` depending on night/day. +The following steps should be followed to set a color or style of a view. +1. Define the color or style: + * Define the color in `core/colors.xml`. Use good naming (`denim_blue`, `mine_shaft_gray` etc..). Our recommended tool for color naming is [Chirag Mehta - Name that color](http://chir.ag/projects/name-that-color/#6195ED). + * Define the style in `core/styles.xml`. For our default styles, applied with theme attributes, the naming convention is `Widget.KiwixTheme.*` and these should ideally inherit from their `Widget.MaterialComponent.*`, should no such parent exist, it is generally advisable to google "how to style [Component]". When there are two or more of a view that differ stylistically from our default styling, but are identical to each other visually, it is appropriate to extract a style to keep the XML DRY. A non-default style should use a descriptive name. e.x. `list_item_title`. +2. Add the color or style to a specific theme attribute in `themes.xml`. +3. Make sure that the color or style works in both day and night mode. If it does not, add the dark mode compatible attribute to `values-night/themes.xml`. + +For a video on how to work with themes, styles and colors, see [Developing Themes with Style (Android Dev Summit '19)](https://www.youtube.com/watch?v=Owkf8DhAOSo). + +## Night Mode / Dark Theme +Night mode is a different theme that has many benefits such as saving battery and improving visibility in low light conditions [2]. When doing any design, make sure the new design works in dark mode. Night mode can be activated from the systems settings or from the kiwix app. + +Whenever a resource exists in both `res/*-night` and `res/*` it will be used as such. For example: `kiwix_icon_with_title.png` exists in both `res/drawable` and `res/drawable-night` which means that the image in `res/drawable-night` will be used automagically in night mode. For further reading on development with dark mode, see [Material Design - Dark Theme](https://developer.android.com/guide/topics/ui/look-and-feel/darktheme). + +## Typography +Text should contrast well, use the correct weight and size to present content as clearly and efficiently as possible. + +Views using the same style often use different text style. Therefore text styles, and view styles are seperated and can be used simultaneously. To keep an android application consistent in style, thirteen text style attributes should be defined. These style attributes can be generated ([Material Design type scale generator](https://material.io/design/typography/the-type-system.html#type-scale)), or defined by editing `core/../values/type.xml`. + +All text should have a text style to simplifiy appearance changes. To set a text style, simply set the `textAppearance` property using one of the thirteen text style attributes from `core/../values/type.xml`. Text can also be grouped if they are related and uses the same text style. This grouping can be done by creating a style that inherits, or sets a specific text appearance. E.x. ` + @color/denim_blue400 + @color/mine_shaft_gray900 + @color/froly_pink300 + + @color/alabaster_white + @color/alabaster_white + @color/alabaster_white + + @color/mine_shaft_gray350 + @color/mine_shaft_gray500 + @color/mine_shaft_gray850 + diff --git a/core/src/main/res/values-pt-rBR/strings.xml b/core/src/main/res/values-pt-rBR/strings.xml index a8e0cacf3..9b259ef8e 100644 --- a/core/src/main/res/values-pt-rBR/strings.xml +++ b/core/src/main/res/values-pt-rBR/strings.xml @@ -80,6 +80,7 @@ Eliminando todo o histórico Limpar marcadores Todos os marcadores limpos + Marcadores selecionados limpos Limpar todo o histórico? Compartilhar Compartilhe arquivos ZIM com: @@ -262,8 +263,10 @@ Sem Favoritos Sem histórico Padrão do dispositivo - Apagar histórico? - Excluir marcadores? + Excluir todo o histórico? + Excluir histórico selecionado? + Excluir todos os favoritos? + Excluir favoritos selecionados? Lig Des Auto diff --git a/core/src/main/res/values-ru/strings.xml b/core/src/main/res/values-ru/strings.xml index 6bc7b1984..4f333b0bc 100644 --- a/core/src/main/res/values-ru/strings.xml +++ b/core/src/main/res/values-ru/strings.xml @@ -89,6 +89,7 @@ Вся история очищена Очистить закладки Все закладки удалены + Выбранные Закладки Очищены Очистить всю историю? Поделиться Поделиться файлами ZIM с: @@ -256,7 +257,7 @@ Устройства не найдены. Нажмите кнопку Поиск чтобы попробовать ещё раз. ФАЙЛЫ ДЛЯ ПЕРЕДАЧИ Подготовка файлов для передачи… - Производим \“рукопожатие\”… + Производим “рукопожатие”… Статус Очистить все заметки во всех статьях Очистить все заметки @@ -271,8 +272,10 @@ Нет Закладок История пуста Настройки устройства по умолчанию - Удалить историю? - Удалить закладки? + Удалить всю историю? + Очистить Выбранную историю? + Удалить все закладки? + Удалить Выбранные Закладки? Вкл Выкл Авто diff --git a/core/src/main/res/values-sr/strings.xml b/core/src/main/res/values-sr/strings.xml index ceeb221d9..6720881d8 100644 --- a/core/src/main/res/values-sr/strings.xml +++ b/core/src/main/res/values-sr/strings.xml @@ -83,8 +83,10 @@ Нема обележивача Нема историјата Подразумеване вредности уређаја - Избрисати историјат? - Избрисати обележиваче? + Избрисати целу историју? + Избрисати изабрану историју? + Избрисати све обележиваче? + Избрисати изабране обележиваче? Укљ. Искљ. Ауто @@ -92,4 +94,5 @@ Детаљи о систему датотека Дијагностички извештај Пошаљите све детаље како бисмо могли да дијагностикујемо проблем + Експериментална навигација diff --git a/core/src/main/res/values-sv/strings.xml b/core/src/main/res/values-sv/strings.xml index ba1025f82..96b94c7a6 100644 --- a/core/src/main/res/values-sv/strings.xml +++ b/core/src/main/res/values-sv/strings.xml @@ -3,6 +3,7 @@ * Abijeet Patro * Jopparn * Skalman +* Susann Schweden * Technic2 * WikiPhoenix --> @@ -40,6 +41,8 @@ Välj filerna du vill vara värd för på servern Startar server Aktivera din WiFi-surfpunkt + WiFi-förbindelse upptäckt + För att kunna se böcker på andra enheter, måste säkerställas att alla enheter är anslutna till samma WiFi-nätverk. För att denna funktion ska fungera måste du först aktivera din WiFi-surfpunkt manuellt eller se till att värdens enhet och mottagarens enhet är på samma nätverk. FORTSÄTT Uppdateringar om tillståndet för din surfpunkt/server. @@ -58,8 +61,8 @@ Visa artiklar med inverterade färger Tillbaka till toppen Visar en knapp i slutet på sidan för att rulla upp till toppen - Dölj verktygsfält vid rullning - Dölj verktygsfältet när sidan rullar nedåt + Fortsätt visa verktygsfältet + Skyddar verktygsfältet från att försvinna när du bläddrar i innehållet Språk Välj ett språk Bidragsgivare och licenser @@ -74,7 +77,8 @@ Rensa senaste sökningar och flikhistorik All historik rensades Rensa bokmärken - Alla bokmärken rensade + Alla bokmärken rensades + Utvalda bokmärken rensades Rensa all historik? Dela Dela ZIM-filer med: @@ -221,6 +225,7 @@ %d bok/böcker Anslutning misslyckades Kan inte komma åt zim-filer utan lagringsbehörighet + Aktivera WiFi P2P i systeminställningar Överför filer till %s? Filöverföring slutfördes Ett fel uppstod under överförning @@ -246,10 +251,14 @@ Inga bokmärken Ingen historik Enhetsstandard - Radera historik? - Radera bokmärken? + Radera all historik? + Radera vald historik? + Radera alla bokmärken? + Radera valda bokmärken? Av Auto + Skicka diagnostisk rapport Filsystemsdetaljer + Diagnostisk rapport diff --git a/core/src/main/res/values-tr/strings.xml b/core/src/main/res/values-tr/strings.xml index 82f02b1be..0f4b71115 100644 --- a/core/src/main/res/values-tr/strings.xml +++ b/core/src/main/res/values-tr/strings.xml @@ -85,6 +85,7 @@ Tüm geçmiş temizlendi Yer imlerini temizle Tüm Yer İmleri Temizlendi + Seçilen Yer İşaretleri Temizlendi Tüm Geçmişi Silinsin mi? Paylaş ZIM dosyalarını şu kişilerle paylaş: @@ -258,7 +259,7 @@ Tüm notları temizle Resim Video - Sadece Metin + Yalnızca Metin Kısa Metin Depolama İzni Reddedildi Bu uygulama çalışması için depolama okuma yeteneği gerektirir. Lütfen ayarlarınızda izin verin @@ -267,8 +268,10 @@ Yer İmi Yok Geçmiş Yok Cihaz Varsayılanı - Geçmiş Silinsin mi? - Yer İşaretleri Silinsin mi? + Tüm Geçmişi Silinsin mi? + Seçilmiş Geçmişi Silinsin mi? + Tüm Yer İşaretleri Silinsin mi? + Seçilmiş Yer İşaretleri Silinsin mi? Açık Kapalı Otomatik @@ -276,7 +279,7 @@ Dosya Sistemi Ayrıntıları Teşhis Raporu Sorunu teşhis edebilmemiz için lütfen aşağıdaki tüm ayrıntıları gönderin - %%%d + %d%% Metin Yakınlığı Deneysel Gezintisi diff --git a/core/src/main/res/values-zh-rTW/strings.xml b/core/src/main/res/values-zh-rTW/strings.xml index f6ced3f06..5bafad6ca 100644 --- a/core/src/main/res/values-zh-rTW/strings.xml +++ b/core/src/main/res/values-zh-rTW/strings.xml @@ -79,6 +79,7 @@ 所有歷史記錄已清除 清除書籤 已清除所有書籤 + 所選的書籤已清除 清除所有歷史記錄? 分享 分享 ZIM 檔案以: @@ -261,8 +262,10 @@ 沒有書籤! 沒有歷史 設備預設 - 刪除歷史? - 刪除書籤? + 刪除所有歷史? + 刪除所選的歷史? + 刪除所有書籤? + 刪除所選的書籤? 開啟 關閉 自動 diff --git a/core/src/main/res/values/attrs.xml b/core/src/main/res/values/attrs.xml index 21b933f1e..2d8f75c76 100644 --- a/core/src/main/res/values/attrs.xml +++ b/core/src/main/res/values/attrs.xml @@ -4,5 +4,8 @@ + + + diff --git a/core/src/main/res/values/colors.xml b/core/src/main/res/values/colors.xml index 5b57d8896..1f2437afb 100644 --- a/core/src/main/res/values/colors.xml +++ b/core/src/main/res/values/colors.xml @@ -1,32 +1,18 @@ + #ffffff + #fafafa + #FFD6D6D6 + #9E9E9E + #5a5a5a + #616161 + #303030 + #212121 #000000 - - #2196F3 - #fafafa - #5a5a5a - #212121 - #42a5f5 - #1565c0 - #f06292 - #4285F4 - #FFD6D6D6 - #9E9E9E - #616161 - #303030 - @color/white - @color/gray700 - @color/gray500 - - - - @color/blue800 - - @color/white - #b00020 - - #ffffff - @color/black - @color/white - + #42a5f5 + #2196F3 + #4285F4 + #1565c0 + #f06292 + #b00020 diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index eba031e2d..3621e5eb7 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -34,7 +34,7 @@ diff --git a/core/src/main/res/values/themes.xml b/core/src/main/res/values/themes.xml index f0f4a0967..8fec99c34 100644 --- a/core/src/main/res/values/themes.xml +++ b/core/src/main/res/values/themes.xml @@ -2,38 +2,50 @@ -