mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 10:46:53 -04:00
1301 create theme based dark mode
This commit is contained in:
parent
33d2106d7c
commit
f1e5e7a7ce
@ -9,7 +9,7 @@
|
||||
<activity
|
||||
android:name=".splash.KiwixSplashActivity"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme.Launcher">
|
||||
android:theme="@style/ThemeOverlay.KiwixTheme.Launcher">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
*/
|
||||
package org.kiwix.kiwixmobile.language.viewmodel
|
||||
|
||||
import android.app.Activity
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import io.reactivex.Flowable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import org.kiwix.kiwixmobile.core.dao.NewLanguagesDao
|
||||
@ -29,7 +29,7 @@ data class SaveLanguagesAndFinish(
|
||||
val languageDao: NewLanguagesDao
|
||||
) : SideEffect<Unit> {
|
||||
|
||||
override fun invokeWith(activity: Activity) {
|
||||
override fun invokeWith(activity: AppCompatActivity) {
|
||||
Flowable.fromCallable { languageDao.insert(languages) }
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe({
|
||||
|
@ -27,6 +27,7 @@ import android.view.ActionMode
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
@ -111,7 +112,7 @@ class ZimFileSelectFragment : BaseFragment() {
|
||||
|
||||
private fun sideEffects() = zimManageViewModel.sideEffects.subscribe(
|
||||
{
|
||||
val effectResult = it.invokeWith(activity!!)
|
||||
val effectResult = it.invokeWith(activity!! as AppCompatActivity)
|
||||
if (effectResult is ActionMode) {
|
||||
actionMode = effectResult
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
package org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects
|
||||
|
||||
import android.app.Activity
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import org.kiwix.kiwixmobile.R
|
||||
import org.kiwix.kiwixmobile.core.base.SideEffect
|
||||
import org.kiwix.kiwixmobile.core.dao.NewBookDao
|
||||
@ -38,7 +38,7 @@ class DeleteFiles(private val booksOnDiskListItem: List<BookOnDisk>) :
|
||||
@Inject lateinit var newBookDao: NewBookDao
|
||||
@Inject lateinit var zimReaderContainer: ZimReaderContainer
|
||||
|
||||
override fun invokeWith(activity: Activity) {
|
||||
override fun invokeWith(activity: AppCompatActivity) {
|
||||
(activity as ZimManageActivity).cachedComponent.inject(this)
|
||||
booksOnDiskListItem.forEach {
|
||||
dialogShower.show(DeleteZim(it), {
|
||||
|
@ -18,10 +18,10 @@
|
||||
|
||||
package org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects
|
||||
|
||||
import android.app.Activity
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import org.kiwix.kiwixmobile.core.base.SideEffect
|
||||
|
||||
object None : SideEffect<Unit> {
|
||||
override fun invokeWith(activity: Activity) {
|
||||
override fun invokeWith(activity: AppCompatActivity) {
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
*/
|
||||
package org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects
|
||||
|
||||
import android.app.Activity
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.net.toUri
|
||||
import org.kiwix.kiwixmobile.core.R
|
||||
import org.kiwix.kiwixmobile.core.base.SideEffect
|
||||
@ -29,7 +29,7 @@ import org.kiwix.kiwixmobile.main.KiwixMainActivity
|
||||
class OpenFile(private val bookOnDisk: BookOnDisk) :
|
||||
SideEffect<Unit> {
|
||||
|
||||
override fun invokeWith(activity: Activity) {
|
||||
override fun invokeWith(activity: AppCompatActivity) {
|
||||
val file = bookOnDisk.file
|
||||
if (!file.canRead()) {
|
||||
activity.toast(R.string.error_file_not_found)
|
||||
|
@ -18,10 +18,10 @@
|
||||
|
||||
package org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.FileProvider
|
||||
import org.kiwix.kiwixmobile.core.R
|
||||
import org.kiwix.kiwixmobile.core.base.SideEffect
|
||||
@ -29,7 +29,7 @@ import org.kiwix.kiwixmobile.core.zim_manager.fileselect_view.adapter.BooksOnDis
|
||||
|
||||
class ShareFiles(private val selectedBooks: List<BookOnDisk>) :
|
||||
SideEffect<Unit> {
|
||||
override fun invokeWith(activity: Activity) {
|
||||
override fun invokeWith(activity: AppCompatActivity) {
|
||||
val selectedFileShareIntent = Intent()
|
||||
selectedFileShareIntent.action = Intent.ACTION_SEND_MULTIPLE
|
||||
selectedFileShareIntent.type = "application/octet-stream"
|
||||
|
@ -18,8 +18,8 @@
|
||||
|
||||
package org.kiwix.kiwixmobile.zim_manager.fileselect_view.effects
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.ActionMode
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.view.ActionMode
|
||||
import io.reactivex.processors.PublishProcessor
|
||||
import org.kiwix.kiwixmobile.core.R
|
||||
import org.kiwix.kiwixmobile.core.base.SideEffect
|
||||
@ -33,7 +33,7 @@ data class StartMultiSelection(
|
||||
val bookOnDisk: BooksOnDiskListItem.BookOnDisk,
|
||||
val fileSelectActions: PublishProcessor<FileSelectActions>
|
||||
) : SideEffect<ActionMode?> {
|
||||
override fun invokeWith(activity: Activity) =
|
||||
override fun invokeWith(activity: AppCompatActivity) =
|
||||
activity.startActionMode(
|
||||
R.menu.menu_zim_files_contextual,
|
||||
mapOf(
|
||||
|
@ -38,7 +38,7 @@ sealed class LibraryDelegate<I : LibraryListItem, out VH : LibraryViewHolder<I>>
|
||||
|
||||
override fun createViewHolder(parent: ViewGroup) =
|
||||
LibraryBookViewHolder(
|
||||
parent.inflate(R.layout.library_item, false),
|
||||
parent.inflate(R.layout.item_library, false),
|
||||
bookUtils,
|
||||
clickAction
|
||||
)
|
||||
|
@ -20,15 +20,15 @@ package org.kiwix.kiwixmobile.zim_manager.library_view.adapter
|
||||
|
||||
import android.view.View
|
||||
import kotlinx.android.synthetic.main.library_divider.divider_text
|
||||
import kotlinx.android.synthetic.main.library_item.creator
|
||||
import kotlinx.android.synthetic.main.library_item.date
|
||||
import kotlinx.android.synthetic.main.library_item.description
|
||||
import kotlinx.android.synthetic.main.library_item.favicon
|
||||
import kotlinx.android.synthetic.main.library_item.fileName
|
||||
import kotlinx.android.synthetic.main.library_item.language
|
||||
import kotlinx.android.synthetic.main.library_item.publisher
|
||||
import kotlinx.android.synthetic.main.library_item.size
|
||||
import kotlinx.android.synthetic.main.library_item.title
|
||||
import kotlinx.android.synthetic.main.item_library.creator
|
||||
import kotlinx.android.synthetic.main.item_library.date
|
||||
import kotlinx.android.synthetic.main.item_library.description
|
||||
import kotlinx.android.synthetic.main.item_library.favicon
|
||||
import kotlinx.android.synthetic.main.item_library.fileName
|
||||
import kotlinx.android.synthetic.main.item_library.language
|
||||
import kotlinx.android.synthetic.main.item_library.publisher
|
||||
import kotlinx.android.synthetic.main.item_library.size
|
||||
import kotlinx.android.synthetic.main.item_library.title
|
||||
import org.kiwix.kiwixmobile.core.CoreApp
|
||||
import org.kiwix.kiwixmobile.core.downloader.model.Base64String
|
||||
import org.kiwix.kiwixmobile.core.extensions.setBitmap
|
||||
|
@ -3,24 +3,18 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
>
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
>
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:theme="@style/AppTheme.AppBarOverlay"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay"
|
||||
/>
|
||||
android:layout_height="wrap_content" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
@ -31,8 +25,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/appbar"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@id/appbar" />
|
||||
|
||||
<androidx.core.widget.ContentLoadingProgressBar
|
||||
android:id="@+id/language_progressbar"
|
||||
@ -42,6 +35,5 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/appbar"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@id/appbar" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -5,7 +5,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true"
|
||||
tools:context="org.kiwix.kiwixmobile.core.zim_manager.library_view.LibraryFragment"
|
||||
tools:context="org.kiwix.kiwixmobile.zim_manager.library_view.LibraryFragment"
|
||||
>
|
||||
|
||||
<TextView
|
||||
|
@ -41,7 +41,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
style="@style/list_item_body"
|
||||
tools:text="Description" />
|
||||
|
||||
<ProgressBar
|
||||
@ -62,14 +62,14 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
style="@style/list_item_body"
|
||||
tools:text="In Progress" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/eta"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
style="@style/list_item_body"
|
||||
tools:text="1min 10secs" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
@ -3,64 +3,59 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
>
|
||||
android:layout_height="64dp">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/item_language_checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginStart="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginEnd="@dimen/activity_horizontal_margin"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_language_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginStart="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginEnd="@dimen/activity_horizontal_margin"
|
||||
android:alpha="0.87"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
style="@style/list_item_title"
|
||||
app:layout_constraintBottom_toTopOf="@id/item_language_localized_name"
|
||||
app:layout_constraintStart_toEndOf="@id/item_language_checkbox"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
tools:text="English"
|
||||
/>
|
||||
tools:text="English" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_language_localized_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.54"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
style="@style/list_item_body"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/item_language_name"
|
||||
app:layout_constraintTop_toBottomOf="@id/item_language_name"
|
||||
tools:text="English"
|
||||
/>
|
||||
tools:text="English" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_language_books_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginStart="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginEnd="@dimen/activity_horizontal_margin"
|
||||
android:alpha="0.54"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
style="@style/list_item_body"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="9 books"
|
||||
/>
|
||||
tools:text="9 books" />
|
||||
|
||||
<View
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:id="@+id/item_language_clickable_area"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
android:background="?selectableItemBackground" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -3,14 +3,14 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||
android:background="?selectableItemBackground"
|
||||
android:minHeight="?listPreferredItemHeight"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
>
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
tools:ignore="Overdraw">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/favicon"
|
||||
@ -21,7 +21,7 @@
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@mipmap/ic_launcher"
|
||||
/>
|
||||
tools:ignore="RtlHardcoded" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
@ -29,62 +29,55 @@
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/dimen_small_padding"
|
||||
tools:ignore="HardcodedText"
|
||||
>
|
||||
tools:ignore="RtlHardcoded,RtlSymmetry">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
style="@style/list_item_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Title"
|
||||
android:textAppearance="?android:attr/textAppearanceListItem"
|
||||
/>
|
||||
tools:text="Title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
style="@style/list_item_body"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Description"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
/>
|
||||
tools:text="Description" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="@dimen/dimen_medium_padding"
|
||||
>
|
||||
android:paddingTop="@dimen/dimen_medium_padding">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/size"
|
||||
style="@style/list_item_body"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="File Size"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
/>
|
||||
tools:text="File Size" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/creator"
|
||||
style="@style/list_item_body"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Author"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
/>
|
||||
tools:text="Author" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/publisher"
|
||||
style="@style/list_item_body"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Publisher"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
/>
|
||||
tools:text="Publisher" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@ -92,37 +85,31 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="right"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
android:gravity="end"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/date"
|
||||
style="@style/list_item_body"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Date"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
/>
|
||||
tools:text="Date" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/language"
|
||||
style="@style/list_item_body"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Language"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
/>
|
||||
tools:text="Language" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fileName"
|
||||
style="@style/list_item_body"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="File Name"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
/>
|
||||
tools:text="File Name" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -4,29 +4,24 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/listBackground"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/file_management_no_files"
|
||||
android:text="@string/no_files_here"
|
||||
tools:ignore="MissingConstraints"
|
||||
style="@style/no_list_content_text"
|
||||
/>
|
||||
android:text="@string/no_files_here"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/zim_swiperefresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/zimfilelist"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
/>
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
|
@ -5,34 +5,27 @@
|
||||
android:id="@+id/zim_manager_main_activity"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="org.kiwix.kiwixmobile.core.zim_manager.ZimManageActivity"
|
||||
>
|
||||
tools:context="org.kiwix.kiwixmobile.zim_manager.ZimManageActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/zim_manage_toolbar_top_padding"
|
||||
android:theme="@style/AppTheme.AppBarOverlay"
|
||||
>
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:layout_scrollFlags="scroll|snap|enterAlways"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay"
|
||||
/>
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
app:popupTheme="@style/KiwixTheme"
|
||||
app:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar" />
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:tabGravity="fill"
|
||||
app:tabMaxWidth="0dp"
|
||||
/>
|
||||
app:tabMaxWidth="0dp" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
@ -40,8 +33,7 @@
|
||||
android:id="@+id/manageViewPager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
|
||||
/>
|
||||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />
|
||||
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
@ -1,4 +1,3 @@
|
||||
import kotlin.String
|
||||
import org.gradle.plugin.use.PluginDependenciesSpec
|
||||
import org.gradle.plugin.use.PluginDependencySpec
|
||||
|
||||
@ -108,7 +107,7 @@ object Versions {
|
||||
|
||||
const val kiwixlib: String = "8.1.0"
|
||||
|
||||
const val material: String = "1.0.0"
|
||||
const val material: String = "1.1.0-beta02"
|
||||
|
||||
const val multidex: String = "2.0.1"
|
||||
|
||||
@ -142,4 +141,4 @@ object Versions {
|
||||
*/
|
||||
val PluginDependenciesSpec.buildSrcVersions: PluginDependencySpec
|
||||
inline get() =
|
||||
id("de.fayard.buildSrcVersions").version(Versions.de_fayard_buildsrcversions_gradle_plugin)
|
||||
id("de.fayard.buildSrcVersions").version(Versions.de_fayard_buildsrcversions_gradle_plugin)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -21,7 +21,7 @@
|
||||
android:hardwareAccelerated="true"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:theme="@style/KiwixTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:targetApi="m">
|
||||
|
||||
|
@ -20,9 +20,7 @@ package org.kiwix.kiwixmobile.core
|
||||
import android.content.Context
|
||||
import android.content.res.Configuration
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import org.kiwix.kiwixmobile.core.NightModeConfig.UiMode.OFF
|
||||
import org.kiwix.kiwixmobile.core.NightModeConfig.UiMode.ON
|
||||
import org.kiwix.kiwixmobile.core.NightModeConfig.UiMode.NOT_SET
|
||||
import org.kiwix.kiwixmobile.core.NightModeConfig.Mode.SYSTEM
|
||||
import org.kiwix.kiwixmobile.core.utils.SharedPreferenceUtil
|
||||
import javax.inject.Inject
|
||||
|
||||
@ -36,9 +34,10 @@ class NightModeConfig @Inject constructor(
|
||||
}
|
||||
|
||||
fun isNightModeActive() =
|
||||
when (uiMode()) {
|
||||
ON -> true
|
||||
OFF, NOT_SET -> false
|
||||
when (sharedPreferenceUtil.nightMode) {
|
||||
Mode.ON -> true
|
||||
Mode.OFF -> false
|
||||
SYSTEM -> uiMode() == UiMode.ON
|
||||
}
|
||||
|
||||
private fun setMode(nightMode: Mode) {
|
||||
|
@ -17,8 +17,8 @@
|
||||
*/
|
||||
package org.kiwix.kiwixmobile.core.base
|
||||
|
||||
import android.app.Activity
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
|
||||
interface SideEffect<out T : Any?> {
|
||||
fun invokeWith(activity: Activity): T
|
||||
fun invokeWith(activity: AppCompatActivity): T
|
||||
}
|
||||
|
@ -20,10 +20,10 @@ package org.kiwix.kiwixmobile.core.extensions
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.view.ActionMode
|
||||
import android.view.ActionMode.Callback
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.view.ActionMode
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
@ -32,12 +32,12 @@ import org.kiwix.kiwixmobile.core.Intents
|
||||
|
||||
object ActivityExtensions {
|
||||
|
||||
fun Activity.startActionMode(
|
||||
fun AppCompatActivity.startActionMode(
|
||||
menuId: Int,
|
||||
idsToClickActions: Map<Int, () -> Any>,
|
||||
onDestroyAction: () -> Unit
|
||||
): ActionMode? {
|
||||
return startActionMode(object : Callback {
|
||||
return startSupportActionMode(object : ActionMode.Callback {
|
||||
override fun onActionItemClicked(
|
||||
mode: ActionMode,
|
||||
item: MenuItem
|
||||
|
@ -18,9 +18,7 @@
|
||||
package org.kiwix.kiwixmobile.core.main;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Typeface;
|
||||
import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@ -39,8 +37,6 @@ public class TableDrawerAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||
private TableClickListener listener;
|
||||
private String title;
|
||||
private List<DocumentSection> sections;
|
||||
private int primary;
|
||||
private int secondary;
|
||||
|
||||
private int selectedPosition = 0;
|
||||
|
||||
@ -50,8 +46,7 @@ public class TableDrawerAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
if (position == 0) return 0;
|
||||
return 1;
|
||||
return position == 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@ -60,14 +55,6 @@ public class TableDrawerAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||
int resource = R.layout.section_list;
|
||||
Context context = parent.getContext();
|
||||
View v = LayoutInflater.from(context).inflate(resource, parent, false);
|
||||
|
||||
TypedValue typedValue = new TypedValue();
|
||||
Resources.Theme theme = context.getTheme();
|
||||
theme.resolveAttribute(android.R.attr.textColorPrimary, typedValue, true);
|
||||
primary = typedValue.data;
|
||||
theme.resolveAttribute(android.R.attr.textColorSecondary, typedValue, true);
|
||||
secondary = typedValue.data;
|
||||
|
||||
if (viewType == 0) return new HeaderViewHolder(v);
|
||||
return new SectionViewHolder(v);
|
||||
}
|
||||
@ -81,7 +68,6 @@ public class TableDrawerAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||
|
||||
if (position == 0) {
|
||||
vh.title.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
vh.title.setTextColor(primary);
|
||||
if (title != null && !title.isEmpty()) {
|
||||
vh.title.setText(title);
|
||||
} else {
|
||||
@ -104,7 +90,6 @@ public class TableDrawerAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
|
||||
float density = context.getResources().getDisplayMetrics().density;
|
||||
int padding = (int) (((documentSection.level - 1) * 16) * density);
|
||||
vh.title.setPadding(padding, 0, 0, 0);
|
||||
vh.title.setTextColor((documentSection.level) % 2 == 0 ? primary : secondary);
|
||||
vh.title.setText(sections.get(sectionPosition).title);
|
||||
vh.itemView.setOnClickListener(v -> {
|
||||
updateSelection(vh.getAdapterPosition());
|
||||
|
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@color/gray_list_bg" android:state_pressed="true" />
|
||||
<item android:drawable="@color/gray_list_bg" android:state_activated="true" />
|
||||
|
||||
</selector>
|
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:drawable="@color/selected_light" android:state_pressed="true" />
|
||||
<item android:drawable="@color/selected_light" android:state_activated="true" />
|
||||
|
||||
</selector>
|
@ -3,24 +3,20 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
>
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
>
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:theme="@style/AppTheme.AppBarOverlay"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay"
|
||||
/>
|
||||
app:popupTheme="@style/KiwixTheme"
|
||||
app:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
@ -31,7 +27,6 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/appbar"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@id/appbar" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -4,26 +4,21 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/listBackground"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".help.HelpActivity"
|
||||
>
|
||||
tools:context=".help.HelpActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/activity_help_appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
>
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/activity_help_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:theme="@style/AppTheme.AppBarOverlay"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay"
|
||||
/>
|
||||
android:layout_height="wrap_content"
|
||||
app:popupTheme="@style/KiwixTheme"
|
||||
app:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<ImageView
|
||||
@ -32,10 +27,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/send_feedback"
|
||||
android:padding="@dimen/activity_horizontal_margin"
|
||||
app:layout_constraintTop_toBottomOf="@id/activity_help_appbar"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:srcCompat="@drawable/ic_feedback_blue_24dp"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@id/activity_help_appbar"
|
||||
app:srcCompat="@drawable/ic_feedback_blue_24dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/activity_help_feedback_text_view"
|
||||
@ -47,16 +41,14 @@
|
||||
app:layout_constraintBottom_toBottomOf="@id/activity_help_feedback_image_view"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/activity_help_feedback_image_view"
|
||||
app:layout_constraintTop_toTopOf="@id/activity_help_feedback_image_view"
|
||||
/>
|
||||
app:layout_constraintTop_toTopOf="@id/activity_help_feedback_image_view" />
|
||||
|
||||
<View
|
||||
android:id="@+id/activity_help_feedback_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?android:attr/listDivider"
|
||||
app:layout_constraintTop_toBottomOf="@id/activity_help_feedback_image_view"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@id/activity_help_feedback_image_view" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/activity_help_recycler_view"
|
||||
@ -66,6 +58,5 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/activity_help_feedback_divider"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@id/activity_help_feedback_divider" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -3,24 +3,20 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
>
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
>
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:theme="@style/AppTheme.AppBarOverlay"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay"
|
||||
/>
|
||||
android:layout_height="wrap_content"
|
||||
app:popupTheme="@style/KiwixTheme"
|
||||
app:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
@ -31,7 +27,6 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/appbar"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@id/appbar" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -5,179 +5,166 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/holo_blue_dark"
|
||||
tools:context=".error.ErrorActivity"
|
||||
>
|
||||
tools:context=".error.ErrorActivity">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/messageText"
|
||||
android:layout_width="332dp"
|
||||
android:layout_height="72dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/crash_description"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView2"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView2" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/reportButton"
|
||||
style="@style/Widget.AppCompat.Button"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:background="@color/white"
|
||||
android:text="@string/crash_button_confirm"
|
||||
android:textColor="@color/black_regular_mat_design"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.173"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
style="@style/Widget.AppCompat.Button"
|
||||
/>
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/restartButton"
|
||||
style="?android:attr/borderlessButtonStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:text="@string/crash_button_decline"
|
||||
android:textColor="@color/blue_grey"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.769"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
style="?android:attr/borderlessButtonStyle"
|
||||
/>
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="60dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/crash_title"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.505"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView2"
|
||||
app:srcCompat="@mipmap/ic_launcher"
|
||||
/>
|
||||
app:srcCompat="@mipmap/ic_launcher" />
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="368dp"
|
||||
android:layout_height="233dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginTop="17dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/reportButton"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/messageText"
|
||||
tools:layout_editor_absoluteX="8dp"
|
||||
>
|
||||
tools:layout_editor_absoluteX="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
android:orientation="vertical">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/allowLanguage"
|
||||
style="@android:style/Widget.Holo.CompoundButton.CheckBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="100dp"
|
||||
android:layout_marginStart="100dp"
|
||||
android:layout_marginLeft="100dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:checked="true"
|
||||
android:text="@string/crash_checkbox_language"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/messageText"
|
||||
style="@android:style/Widget.Holo.CompoundButton.CheckBox"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@+id/messageText" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/allowLogs"
|
||||
style="@android:style/Widget.Holo.CompoundButton.CheckBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="100dp"
|
||||
android:layout_marginStart="100dp"
|
||||
android:layout_marginLeft="100dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:checked="true"
|
||||
android:text="@string/crash_checkbox_logs"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/allowCrash"
|
||||
style="@android:style/Widget.Holo.CompoundButton.CheckBox"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@+id/allowCrash" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/allowCrash"
|
||||
style="@android:style/Widget.Holo.CompoundButton.CheckBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="100dp"
|
||||
android:layout_marginStart="100dp"
|
||||
android:layout_marginLeft="100dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:checked="true"
|
||||
android:text="@string/crash_checkbox_exception"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/allowZims"
|
||||
style="@android:style/Widget.Holo.CompoundButton.CheckBox"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@+id/allowZims" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/allowZims"
|
||||
style="@android:style/Widget.Holo.CompoundButton.CheckBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="100dp"
|
||||
android:layout_marginStart="100dp"
|
||||
android:layout_marginLeft="100dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:checked="true"
|
||||
android:text="@string/crash_checkbox_zimfiles"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/allowLanguage"
|
||||
style="@android:style/Widget.Holo.CompoundButton.CheckBox"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@+id/allowLanguage" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/allowDeviceDetails"
|
||||
style="@android:style/Widget.Holo.CompoundButton.CheckBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="100dp"
|
||||
android:layout_marginStart="100dp"
|
||||
android:layout_marginLeft="100dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:checked="true"
|
||||
android:text="@string/crash_checkbox_device"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/allowLogs"
|
||||
style="@android:style/Widget.Holo.CompoundButton.CheckBox"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@+id/allowLogs" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -25,7 +25,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="end"
|
||||
android:background="?attr/drawerBackground"
|
||||
android:fitsSystemWindows="true"
|
||||
app:headerLayout="@layout/drawer_right" />
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
||||
|
@ -5,64 +5,58 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".webserver.ZimHostActivity"
|
||||
>
|
||||
tools:context=".webserver.ZimHostActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/zimHostAppBarLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
>
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:theme="@style/AppTheme.AppBarOverlay"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay"
|
||||
/>
|
||||
android:layout_height="wrap_content"
|
||||
app:popupTheme="@style/KiwixTheme"
|
||||
app:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/server_textView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/server_textview_default_message"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/zimHostAppBarLayout"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@+id/zimHostAppBarLayout" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view_zim_host"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintBottom_toTopOf="@+id/startServerButton"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/server_textView"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@+id/server_textView" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/startServerButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@color/greenTick"
|
||||
android:text="@string/start_server_label"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -5,86 +5,79 @@
|
||||
android:id="@+id/bottom_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bottom_toolbar_height"
|
||||
android:background="@color/black"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:visibility="visible"
|
||||
>
|
||||
tools:visibility="visible">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/primary"
|
||||
>
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bottom_toolbar_bookmark"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:contentDescription="@string/menu_bookmarks"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/bottom_toolbar_arrow_back"
|
||||
app:layout_constraintHorizontal_chainStyle="spread"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_bookmark_border_24dp"
|
||||
/>
|
||||
app:srcCompat="@drawable/ic_bookmark_border_24dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bottom_toolbar_arrow_back"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:contentDescription="@string/go_to_previous_page"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/bottom_toolbar_home"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_toolbar_bookmark"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_keyboard_arrow_left_24dp"
|
||||
/>
|
||||
app:srcCompat="@drawable/ic_keyboard_arrow_left_24dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bottom_toolbar_home"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:contentDescription="@string/menu_home"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/bottom_toolbar_arrow_forward"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_toolbar_arrow_back"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/action_home"
|
||||
/>
|
||||
app:srcCompat="@drawable/action_home" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bottom_toolbar_arrow_forward"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:contentDescription="@string/go_to_next_page"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/bottom_toolbar_toc"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_toolbar_home"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_keyboard_arrow_right_24dp"
|
||||
/>
|
||||
app:srcCompat="@drawable/ic_keyboard_arrow_right_24dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bottom_toolbar_toc"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:contentDescription="@string/table_of_contents"
|
||||
android:paddingBottom="12dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_toolbar_arrow_forward"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_toc_24dp"
|
||||
/>
|
||||
app:srcCompat="@drawable/ic_toc_24dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
||||
|
@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
android:layout_height="match_parent" />
|
||||
|
@ -2,16 +2,14 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/file_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp"
|
||||
android:textSize="18sp"
|
||||
/>
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/file_size"
|
||||
@ -20,10 +18,9 @@
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_toEndOf="@id/file_name"
|
||||
android:layout_toRightOf="@id/file_name"
|
||||
android:gravity="end"
|
||||
android:padding="10dp"
|
||||
android:textSize="18sp"
|
||||
android:layout_toRightOf="@id/file_name"
|
||||
/>
|
||||
android:textSize="18sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -1,82 +1,74 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/transparent"
|
||||
>
|
||||
android:background="@android:color/transparent">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/app_bar_add_note_dialog"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
>
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/add_note_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
></androidx.appcompat.widget.Toolbar>
|
||||
android:layout_height="wrap_content"></androidx.appcompat.widget.Toolbar>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/app_bar_add_note_dialog"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
>
|
||||
app:layout_constraintTop_toBottomOf="@id/app_bar_add_note_dialog">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/add_note_text_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:background="@android:color/transparent"
|
||||
android:hint="@string/wiki_article_title"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline5"
|
||||
android:paddingTop="10dp"
|
||||
android:maxLines="1"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="20dp"
|
||||
/>
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline5" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginRight="15dp"
|
||||
android:background="#000000"
|
||||
/>
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="#000000" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/add_note_edit_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:gravity="top|left"
|
||||
android:hint="@string/note"
|
||||
android:inputType="textMultiLine|textCapSentences|textAutoCorrect"
|
||||
android:minLines="6"
|
||||
android:gravity="top|left"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:scrollbars="vertical"
|
||||
android:background="@android:color/transparent"
|
||||
android:hint="@string/note"
|
||||
/>
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" />
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
@ -5,5 +5,4 @@
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="true"
|
||||
android:fitsSystemWindows="true"
|
||||
android:focusable="true"
|
||||
/>
|
||||
android:focusable="true" />
|
||||
|
@ -3,8 +3,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/header_date"
|
||||
@ -16,6 +15,5 @@
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="English"
|
||||
/>
|
||||
tools:text="English" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -3,18 +3,15 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/header_language"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/activity_horizontal_margin"
|
||||
android:textColor="@color/textDarkPrimary"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="English"
|
||||
/>
|
||||
tools:text="English" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -4,10 +4,8 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingStart="12dp"
|
||||
android:theme="@style/AppTheme"
|
||||
>
|
||||
android:paddingEnd="12dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ic_tab_switcher_text"
|
||||
@ -23,6 +21,5 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="12"
|
||||
tools:textColor="@android:color/black"
|
||||
/>
|
||||
tools:textColor="@android:color/black" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -45,12 +45,11 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_book_title"
|
||||
style="@style/list_item_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginEnd="@dimen/activity_horizontal_margin"
|
||||
android:textColor="@color/textDarkPrimary"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/item_book_icon"
|
||||
app:layout_constraintTop_toBottomOf="@+id/vertical_padding"
|
||||
@ -58,42 +57,42 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_book_date"
|
||||
style="@style/list_item_body"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/textDarkSecondary"
|
||||
app:layout_constraintStart_toStartOf="@id/item_book_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/item_book_title"
|
||||
tools:text="1 Jan 2018" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_book_size"
|
||||
style="@style/list_item_body"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginEnd="@dimen/activity_horizontal_margin"
|
||||
android:textColor="@color/textDarkSecondary"
|
||||
app:layout_constraintStart_toEndOf="@id/item_book_date"
|
||||
app:layout_constraintTop_toTopOf="@id/item_book_date"
|
||||
tools:text="20 GB" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_book_article_count"
|
||||
style="@style/list_item_body"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginEnd="@dimen/activity_horizontal_margin"
|
||||
android:textColor="@color/textDarkSecondary"
|
||||
app:layout_constraintStart_toEndOf="@id/item_book_size"
|
||||
app:layout_constraintTop_toTopOf="@id/item_book_size"
|
||||
tools:text="10.1 K articles" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_book_description"
|
||||
style="@style/list_item_body"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:textColor="@color/textDarkSecondary"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/item_book_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/item_book_date"
|
||||
@ -101,6 +100,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_book_label_picture"
|
||||
style="@style/list_item_body"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/border_label_picture"
|
||||
@ -114,6 +114,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_book_label_video"
|
||||
style="@style/list_item_body"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
|
@ -3,24 +3,22 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/favicon"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginEnd="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginStart="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:contentDescription="@string/fav_icon"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:src="@mipmap/ic_launcher_round"
|
||||
/>
|
||||
tools:src="@mipmap/ic_launcher_round" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
@ -29,13 +27,12 @@
|
||||
android:layout_marginEnd="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginRight="@dimen/activity_horizontal_margin"
|
||||
android:alpha="0.87"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/favicon"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="Wikipedia - Main Page"
|
||||
/>
|
||||
tools:text="Wikipedia - Main Page" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -4,8 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/activity_horizontal_margin"
|
||||
>
|
||||
android:padding="@dimen/activity_horizontal_margin">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_help_title"
|
||||
@ -15,8 +14,7 @@
|
||||
app:layout_constraintEnd_toStartOf="@id/item_help_toggle_expand"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="@string/help_2"
|
||||
/>
|
||||
tools:text="@string/help_2" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/item_help_toggle_expand"
|
||||
@ -27,18 +25,16 @@
|
||||
app:layout_constraintBottom_toBottomOf="@id/item_help_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/item_help_title"
|
||||
app:srcCompat="@drawable/action_find_next"
|
||||
/>
|
||||
app:srcCompat="@drawable/action_find_next" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_help_description"
|
||||
style="@style/list_item_body"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toBottomOf="@id/item_help_title"
|
||||
tools:text="@string/help_3"
|
||||
tools:visibility="visible"
|
||||
/>
|
||||
tools:visibility="visible" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -4,8 +4,7 @@
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="24dp"
|
||||
>
|
||||
android:padding="24dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="160dp"
|
||||
@ -15,8 +14,7 @@
|
||||
app:layout_constraintBottom_toTopOf="@id/heading"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/heading"
|
||||
@ -30,16 +28,14 @@
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toTopOf="@id/subheading"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_end="56dp"
|
||||
/>
|
||||
app:layout_constraintGuide_end="56dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subheading"
|
||||
@ -47,10 +43,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/human_kind_knowledge"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/textDarkSecondary"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/guideline"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@id/guideline" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -4,8 +4,7 @@
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="24dp"
|
||||
>
|
||||
android:padding="24dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/airplane"
|
||||
@ -17,8 +16,7 @@
|
||||
app:layout_constraintBottom_toTopOf="@id/heading"
|
||||
app:layout_constraintEnd_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_airplane"
|
||||
/>
|
||||
app:srcCompat="@drawable/ic_airplane" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/heading"
|
||||
@ -32,16 +30,14 @@
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toTopOf="@id/subheading"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_end="56dp"
|
||||
/>
|
||||
app:layout_constraintGuide_end="56dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subheading"
|
||||
@ -49,10 +45,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/download_books_message"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/textDarkSecondary"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/guideline"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@id/guideline" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -8,16 +8,14 @@
|
||||
android:background="@drawable/search_widget_background"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/kiwix_search_widget_padding"
|
||||
>
|
||||
android:padding="@dimen/kiwix_search_widget_padding">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/search_widget_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.1"
|
||||
android:src="@mipmap/ic_launcher"
|
||||
/>
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/search_widget_text"
|
||||
@ -25,23 +23,20 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.7"
|
||||
android:text="@string/search_widget_text"
|
||||
android:textColor="@color/grey"
|
||||
/>
|
||||
android:textColor="@color/grey" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/search_widget_star"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.1"
|
||||
app:srcCompat="@drawable/ic_stars_black_24dp"
|
||||
/>
|
||||
app:srcCompat="@drawable/ic_stars_black_24dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/search_widget_mic"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.1"
|
||||
app:srcCompat="@drawable/ic_mic_black_24dp"
|
||||
/>
|
||||
app:srcCompat="@drawable/ic_mic_black_24dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/activity_main_root"
|
||||
android:layout_width="match_parent"
|
||||
@ -20,19 +20,17 @@
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/activity_main_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@android:color/black"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:theme="@style/AppTheme.AppBarOverlay"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||
app:popupTheme="@style/KiwixTheme"
|
||||
app:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar" />
|
||||
|
||||
<org.kiwix.kiwixmobile.core.main.AnimatedProgressBar
|
||||
android:id="@+id/activity_main_progress_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/progress_view_height"
|
||||
app:backgroundColor="?attr/progressBackgroundColor"
|
||||
app:backgroundColor="?colorOnSurface"
|
||||
app:bidirectionalAnimate="false"
|
||||
app:layout_constraintBottom_toBottomOf="@id/activity_main_toolbar"
|
||||
app:progressColor="@color/accent" />
|
||||
|
@ -3,24 +3,21 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginTop="@dimen/progressbar_layout_margin_top"
|
||||
>
|
||||
android:layout_marginTop="@dimen/progressbar_layout_margin_top">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="-1dp"
|
||||
android:background="?android:attr/listDivider"
|
||||
/>
|
||||
android:background="?android:attr/listDivider" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="?android:attr/progressBarStyleLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:padding="@dimen/progressbar_padding"
|
||||
style="?android:attr/progressBarStyleLarge"
|
||||
/>
|
||||
android:padding="@dimen/progressbar_padding" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@ -30,7 +27,6 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingTop="@dimen/progressbar_textview_vertical_padding"
|
||||
android:text="@string/rescan_fs_warning"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
android:textStyle="bold" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -4,37 +4,29 @@
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
android:layoutDirection="ltr"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/actionBarSize"
|
||||
>
|
||||
android:layout_height="?android:attr/actionBarSize">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?android:attr/actionBarSize"
|
||||
android:background="?colorPrimaryDark"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay"
|
||||
app:theme="@style/AppTheme.AppBarOverlay"
|
||||
/>
|
||||
android:layout_height="wrap_content"
|
||||
app:popupTheme="@style/KiwixTheme"
|
||||
app:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar" />
|
||||
</RelativeLayout>
|
||||
|
||||
<ListView
|
||||
android:id="@+id/search_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/listBackground"
|
||||
/>
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -2,12 +2,10 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/section_list_height"
|
||||
android:background="?attr/selectedBackground"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/titleText"
|
||||
@ -22,7 +20,6 @@
|
||||
android:maxLines="1"
|
||||
android:minHeight="?android:attr/listPreferredItemHeightSmall"
|
||||
android:paddingLeft="@dimen/title_text_padding"
|
||||
android:textAppearance="?android:attr/textAppearanceListItemSmall"
|
||||
/>
|
||||
android:textAppearance="?android:attr/textAppearanceListItemSmall" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -3,37 +3,30 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
android:background="?attr/listBackground"
|
||||
>
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
>
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:theme="@style/AppTheme.AppBarOverlay"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay"
|
||||
/>
|
||||
android:layout_height="wrap_content"
|
||||
app:popupTheme="@style/KiwixTheme"
|
||||
app:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/content_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/listBackground"
|
||||
/>
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
@ -3,25 +3,22 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/dimen_medium_padding"
|
||||
android:paddingLeft="@dimen/slider_dialog_horizontal_padding"
|
||||
android:paddingRight="@dimen/slider_dialog_horizontal_padding"
|
||||
android:paddingTop="@dimen/dimen_medium_padding"
|
||||
>
|
||||
android:paddingRight="@dimen/slider_dialog_horizontal_padding"
|
||||
android:paddingBottom="@dimen/dimen_medium_padding">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
/>
|
||||
android:gravity="center" />
|
||||
|
||||
<SeekBar
|
||||
android:id="@+id/slider_preference_seekbar"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/slider_preference_seekbar_horizontal_padding"
|
||||
android:paddingTop="@dimen/slider_preference_seekbar_horizontal_padding"
|
||||
/>
|
||||
android:paddingBottom="@dimen/slider_preference_seekbar_horizontal_padding" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -3,8 +3,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp"
|
||||
>
|
||||
android:padding="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
@ -12,12 +11,10 @@
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:textAlignment="center"
|
||||
android:textSize="22sp"
|
||||
/>
|
||||
android:textSize="22sp" />
|
||||
|
||||
<ListView
|
||||
android:id="@+id/device_list"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
@ -3,17 +3,14 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/black"
|
||||
android:fitsSystemWindows="true"
|
||||
>
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/tab_switcher_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
/>
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/tab_switcher_close_all_tabs"
|
||||
@ -25,6 +22,5 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:srcCompat="@drawable/ic_close_black_24dp"
|
||||
/>
|
||||
app:srcCompat="@drawable/ic_close_black_24dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -17,8 +17,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/edit"
|
||||
@ -32,8 +31,8 @@
|
||||
android:inputType="text"
|
||||
android:scrollHorizontally="true"
|
||||
android:textColor="@android:color/white"
|
||||
android:textColorHint="@color/material_dark_foreground_hint"
|
||||
>
|
||||
android:textColorHint="@color/material_dark_foreground_hint">
|
||||
|
||||
<requestFocus />
|
||||
</EditText>
|
||||
|
||||
@ -45,6 +44,5 @@
|
||||
android:layout_marginRight="4dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@android:color/darker_gray"
|
||||
tools:text="2/10"
|
||||
/>
|
||||
tools:text="2/10" />
|
||||
</LinearLayout>
|
||||
|
16
core/src/main/res/values-night/color.xml
Normal file
16
core/src/main/res/values-night/color.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!--DARK COLOR THEME-->
|
||||
<!--The same color values are defined for dark theme, but with values more appropriate for -->
|
||||
<!--low-luminance UIs. These colors will be used by night/themes.xml.-->
|
||||
|
||||
<color name="color_primary">@color/blue800</color>
|
||||
|
||||
<color name="color_surface">#121212</color>
|
||||
<color name="color_error">#cf6679</color>
|
||||
|
||||
<color name="color_on_primary">@color/white</color>
|
||||
<color name="color_on_surface">@color/white</color>
|
||||
<color name="color_on_error">@color/white</color>
|
||||
</resources>
|
9
core/src/main/res/values-night/themes.xml
Normal file
9
core/src/main/res/values-night/themes.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!--Top level DayNight theme to be used in AndroidManifest.xml-->
|
||||
<style name="KiwixTheme" parent="Base.KiwixTheme">
|
||||
<!-- Dark theme customisations here-->
|
||||
</style>
|
||||
|
||||
</resources>
|
@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorPrimary">@color/primary</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark</item>
|
||||
<item name="colorAccent">@color/accent</item>
|
||||
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
|
||||
<item name="searchViewStyle">@style/SearchViewStyle</item>
|
||||
<item name="android:textCursorDrawable">@null</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="actionModeBackground">@color/actionModeBackground</item>
|
||||
<item name="progressBackgroundColor">@color/primary_dark</item>
|
||||
<item name="listBackground">@drawable/list_bg</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
<item name="arrowBackDrawable">@drawable/ic_action_back</item>
|
||||
<item name="arrowForwardDrawable">@drawable/ic_action_forward</item>
|
||||
<item name="drawerBackground">@color/drawer_background_day</item>
|
||||
<item name="plusDrawable">@drawable/ic_action_plus</item>
|
||||
<item name="deleteDrawable">@drawable/ic_action_delete</item>
|
||||
<item name="dividerColor">@color/divider_light</item>
|
||||
<item name="selectedBackground">@drawable/list_bg_light</item>
|
||||
<item name="android:itemBackground">@color/primary_light</item>
|
||||
<item name="android:textColorPrimary">@color/primary</item>
|
||||
<item name="android:textColorSecondary">@color/primary</item>
|
||||
<item name="android:textColorTertiary">@color/primary</item>
|
||||
<item name="colorControlNormal">@color/accent</item>
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
</style>
|
||||
</resources>
|
@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorPrimary">@color/primary</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark</item>
|
||||
<item name="colorAccent">@color/accent</item>
|
||||
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
|
||||
<item name="searchViewStyle">@style/SearchViewStyle</item>
|
||||
<item name="android:textCursorDrawable">@null</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="progressBackgroundColor">@color/primary_dark</item>
|
||||
<item name="actionModeBackground">@color/actionModeBackground</item>
|
||||
<item name="listBackground">@drawable/list_bg</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
<item name="arrowBackDrawable">@drawable/ic_action_back</item>
|
||||
<item name="arrowForwardDrawable">@drawable/ic_action_forward</item>
|
||||
<item name="drawerBackground">@color/drawer_background_day</item>
|
||||
<item name="plusDrawable">@drawable/ic_action_plus</item>
|
||||
<item name="deleteDrawable">@drawable/ic_action_delete</item>
|
||||
<item name="dividerColor">@color/divider_light</item>
|
||||
<item name="selectedBackground">@drawable/list_bg_light</item>
|
||||
<item name="android:itemBackground">@color/primary_light</item>
|
||||
<item name="android:textColorPrimary">@color/primary</item>
|
||||
<item name="android:textColorSecondary">@color/primary</item>
|
||||
<item name="android:textColorTertiary">@color/primary</item>
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
<item name="colorControlNormal">@color/accent</item>
|
||||
<item name="android:progressBackgroundTint">@color/greyed_out_selected</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
</style>
|
||||
</resources>
|
@ -1,25 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<resources>
|
||||
|
||||
<attr format="color" name="progressBackgroundColor" />
|
||||
<attr format="integer" name="arrowBackDrawable" />
|
||||
<attr format="integer" name="arrowForwardDrawable" />
|
||||
<attr format="reference|color" name="listBackground" />
|
||||
<attr format="reference|color" name="drawerBackground" />
|
||||
<attr format="reference|color" name="plusDrawable" />
|
||||
<attr format="reference|color" name="deleteDrawable" />
|
||||
<attr format="reference|color" name="tabDrawable" />
|
||||
<attr format="reference|color" name="dividerColor" />
|
||||
<attr format="reference|color" name="selectedBackground" />
|
||||
|
||||
<declare-styleable name="SliderPreference">
|
||||
<attr name="android:summary" />
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="AnimatedProgressBar">
|
||||
<attr format="color" name="progressColor" />
|
||||
<attr format="color" name="backgroundColor" />
|
||||
<attr format="boolean" name="bidirectionalAnimate" />
|
||||
<attr name="progressColor" format="color" />
|
||||
<attr name="backgroundColor" format="color" />
|
||||
<attr name="bidirectionalAnimate" format="boolean" />
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
|
@ -1,41 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="primary">#000000</color>
|
||||
<color name="primary_night">#ff212121</color>
|
||||
<color name="primary_dark">#000000</color>
|
||||
<color name="primary_dark_night">#ff212121</color>
|
||||
<color name="primary_light">#ffffff</color>
|
||||
<color name="black">#000000</color>
|
||||
|
||||
<color name="accent">#2196F3</color>
|
||||
<color name="icons">#212121</color>
|
||||
<color name="white">#fafafa</color>
|
||||
<color name="gray_list_bg">#0d000000</color>
|
||||
<color name="drawer_background_day">#ffffff</color>
|
||||
<color name="drawer_background_night">#5a5a5a</color>
|
||||
<color name="selected_light">#0F000000</color>
|
||||
<color name="divider_light">#2b3f6a</color>
|
||||
<color name="greyed_out_selected">#BDBDBD</color>
|
||||
<color name="black_regular_mat_design">#212121</color>
|
||||
<color name="grey">#5a5a5a</color>
|
||||
<color name="blue_grey">#ECEFF1</color>
|
||||
<color name="foreground_material_dark">@android:color/white</color>
|
||||
<color name="back_to_top_background">#DDFFFFFF</color>
|
||||
<color name="picture_label">#fb8c00</color>
|
||||
<color name="video_label">#651FFF</color>
|
||||
<color name="blue800">#1565c0</color>
|
||||
<color name="blueTransparent">#962e7ac4</color>
|
||||
<color name="actionModeBackground">#4285F4</color>
|
||||
<color name="titleBar">#000000</color>
|
||||
<color name="greenTick">#4CAF50</color>
|
||||
<color name="stopServer">#E53935</color>
|
||||
|
||||
<!-- Dark Text Color for Light Background -->
|
||||
<color name="textDarkPrimary">#000000</color> <!-- 0% opacity-->
|
||||
<color name="textDarkSecondary">#DE000000</color> <!--DE for 87% opacity-->
|
||||
<color name="textDarkTertiary">#8A000000</color> <!--8A for 54% opacity-->
|
||||
|
||||
<!-- White Text Color for Dark Background -->
|
||||
<color name="textLightPrimary">#FFFFFF</color> <!--100% opacity-->
|
||||
<color name="textLightSecondary">#B2FFFFFF</color> <!--B2 for 70% opacity-->
|
||||
<color name="textLightTertiary">#80FFFFFF</color> <!--80 for 50% opacity-->
|
||||
<!--Material Components Colors-->
|
||||
|
||||
<color name="color_primary">@color/blue800</color>
|
||||
|
||||
<color name="color_surface">@color/white</color>
|
||||
<color name="color_error">#b00020</color>
|
||||
|
||||
<color name="color_on_primary">#ffffff</color>
|
||||
<color name="color_on_surface">@color/black</color>
|
||||
<color name="color_on_error">@color/white</color>
|
||||
|
||||
</resources>
|
||||
|
35
core/src/main/res/values/shape.xml
Normal file
35
core/src/main/res/values/shape.xml
Normal file
@ -0,0 +1,35 @@
|
||||
<resources>
|
||||
|
||||
<!--Shape-->
|
||||
|
||||
<!--Material allows theming of a component’s shape through the customization of corner -->
|
||||
<!--style and radius size. To systematically apply shape throughout your app, it helps to -->
|
||||
<!--understand that components are categorized by size, grouped into categories of small, -->
|
||||
<!--medium and large. Each component size group can be themed by overriding the Material -->
|
||||
<!--Components attributes ?shapeAppearanceSmallComponent, ?shapeAppearanceMediumComponent -->
|
||||
<!--and ?shapeAppearanceLargeComponent in your app's theme. Those attributes are already -->
|
||||
<!--defined as default stylesoverridden for you in themes.xml and point to the styles in -->
|
||||
<!--this file.-->
|
||||
|
||||
<!--Experiment with ShapeAppearance properties such as cornerFamily (either ‘cut’ or -->
|
||||
<!--‘rounded’) and corner size. Alternatively, customize each ShapeAppearance on a -->
|
||||
<!--per-corner basis with cornerFamilyTopLeft, cornerFamilyTopRight, cornerFamilyBottomLeft, -->
|
||||
<!--cornerFamilyBottomRight and cornerSizeTopRight, cornerSizeTopLeft, cornerSizeBottomLeft -->
|
||||
<!--and cornerSizeBottomRight.-->
|
||||
|
||||
<!--Shape Appearance for small components like chips, buttons, text fields and FABs-->
|
||||
<style name="ShapeAppearance.KiwixTheme.SmallComponent" parent="ShapeAppearance.MaterialComponents.SmallComponent">
|
||||
<!--Your custom shape here-->
|
||||
</style>
|
||||
|
||||
<!--Shape Appearance for medium components like cards, alert dialogs-->
|
||||
<style name="ShapeAppearance.KiwixTheme.MediumComponent" parent="ShapeAppearance.MaterialComponents.MediumComponent">
|
||||
<!--Your custom shape here-->
|
||||
</style>
|
||||
|
||||
<!--Shape Appearance for large components like side and bottom navigation drawers-->
|
||||
<style name="ShapeAppearance.KiwixTheme.LargeComponent" parent="ShapeAppearance.MaterialComponents.LargeComponent">
|
||||
<!--Your custom shape here-->
|
||||
</style>
|
||||
|
||||
</resources>
|
@ -1,160 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="AppTheme" parent="AppTheme.Base" />
|
||||
|
||||
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorPrimary">@color/primary</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark</item>
|
||||
<item name="colorAccent">@color/accent</item>
|
||||
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
|
||||
<item name="searchViewStyle">@style/SearchViewStyle</item>
|
||||
<item name="android:textCursorDrawable">@null</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="actionModeBackground">@color/actionModeBackground</item>
|
||||
<item name="progressBackgroundColor">@color/primary_dark</item>
|
||||
<item name="listBackground">@drawable/list_bg</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
<item name="arrowBackDrawable">@drawable/ic_action_back</item>
|
||||
<item name="arrowForwardDrawable">@drawable/ic_action_forward</item>
|
||||
<item name="drawerBackground">@color/drawer_background_day</item>
|
||||
<item name="plusDrawable">@drawable/ic_action_plus</item>
|
||||
<item name="deleteDrawable">@drawable/ic_action_delete</item>
|
||||
<item name="dividerColor">@color/divider_light</item>
|
||||
<item name="selectedBackground">@drawable/list_bg_light</item>
|
||||
<item name="android:itemBackground">@color/primary_light</item>
|
||||
<item name="android:textColorPrimary">@color/textDarkPrimary</item>
|
||||
<item name="android:textColorSecondary">@color/textDarkSecondary</item>
|
||||
<item name="android:textColorTertiary">@color/textDarkTertiary</item>
|
||||
<item name="colorControlNormal">@color/accent</item>
|
||||
<style name="ThemeOverlay.KiwixTheme.BottomSheetDialog" parent="ThemeOverlay.MaterialComponents.Dialog">
|
||||
<item name="android:windowIsFloating">false</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:statusBarColor" tools:ignore="NewApi">@android:color/transparent</item>
|
||||
<item name="bottomSheetStyle">@style/Widget.KiwixTheme.BottomSheet.Modal</item>
|
||||
<item name="android:navigationBarColor" tools:ignore="NewApi">?colorSurface</item>
|
||||
<item name="android:navigationBarDividerColor" tools:ignore="NewApi">
|
||||
@android:color/transparent
|
||||
</item>
|
||||
</style>
|
||||
|
||||
<style name="StatusBarTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<item name="colorPrimaryDark">@color/titleBar</item>
|
||||
<item name="colorPrimary">@color/primary</item>
|
||||
<item name="colorAccent">@color/accent</item>
|
||||
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
|
||||
<item name="searchViewStyle">@style/SearchViewStyle</item>
|
||||
<item name="android:textCursorDrawable">@null</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="actionModeBackground">@color/actionModeBackground</item>
|
||||
<item name="progressBackgroundColor">@color/primary_dark</item>
|
||||
<item name="listBackground">@drawable/list_bg</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
<item name="selectedBackground">@drawable/list_bg_light</item>
|
||||
<item name="android:itemBackground">@color/primary_light</item>
|
||||
<item name="drawerBackground">@color/drawer_background_day</item>
|
||||
<item name="dividerColor">@color/divider_light</item>
|
||||
<item name="android:textColorPrimary">@color/textDarkPrimary</item>
|
||||
<item name="android:textColorSecondary">@color/textDarkSecondary</item>
|
||||
<item name="android:textColorTertiary">@color/textDarkTertiary</item>
|
||||
<item name="colorControlNormal">@color/accent</item>
|
||||
<item name="buttonStyle">@style/KiwixButtonStyle</item>
|
||||
<style name="Widget.KiwixTheme.BottomSheet.Modal" parent="Widget.MaterialComponents.BottomSheet.Modal">
|
||||
<item name="shapeAppearanceOverlay">?shapeAppearanceLargeComponent</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.Night" parent="AppTheme.Base">
|
||||
<item name="colorPrimary">@color/primary_night</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark_night</item>
|
||||
<item name="colorAccent">@color/accent</item>
|
||||
<item name="progressBackgroundColor">@color/primary_dark_night</item>
|
||||
<item name="drawerBackground">@color/drawer_background_night</item>
|
||||
<item name="listBackground">@color/grey</item>
|
||||
<item name="android:itemBackground">@color/grey</item>
|
||||
<item name="android:itemTextAppearance">@color/grey</item>
|
||||
<item name="android:textColor">@color/primary_light</item>
|
||||
<item name="android:textColorPrimary">@color/textLightPrimary</item>
|
||||
<item name="android:textColorSecondary">@color/textLightSecondary</item>
|
||||
<item name="android:textColorTertiary">@color/textLightTertiary</item>
|
||||
<item name="android:alertDialogTheme">@style/AppTheme.Dialog.Night</item>
|
||||
<item name="colorControlNormal">@color/accent</item>
|
||||
<style name="Widget.KiwixTheme.NavigationView" parent="Widget.MaterialComponents.NavigationView">
|
||||
<item name="itemTextAppearance">?textAppearanceBody2</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.Launcher">
|
||||
<style name="Widget.KiwixTheme.Toolbar" parent="Widget.MaterialComponents.Toolbar.PrimarySurface">
|
||||
<item name="android:background">@color/black</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeOverlay.KiwixTheme.Launcher" parent="">
|
||||
<item name="android:windowBackground">@drawable/launch_screen</item>
|
||||
</style>
|
||||
|
||||
<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
|
||||
<item name="spinBars">true</item>
|
||||
<style name="Widget.KiwixTheme.TabLayout" parent="Widget.MaterialComponents.TabLayout">
|
||||
<item name="android:background">@color/black</item>
|
||||
<item name="tabTextColor">@color/white</item>
|
||||
</style>
|
||||
|
||||
<style name="SearchViewStyle" parent="Widget.AppCompat.SearchView" />
|
||||
|
||||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
|
||||
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat">
|
||||
<item name="android:textColorPrimary">@color/textDarkPrimary</item>
|
||||
<item name="actionMenuTextColor">@color/textDarkPrimary</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.Dialog" parent="Theme.AppCompat.Light.Dialog.Alert">
|
||||
<item name="colorAccent">@color/accent</item>
|
||||
<item name="android:textColorPrimary">@color/primary_dark</item>
|
||||
<item name="buttonBarNegativeButtonStyle">@style/NegativeButtonStyle</item>
|
||||
<item name="buttonBarPositiveButtonStyle">@style/PositiveButtonStyle</item>
|
||||
<item name="buttonBarNeutralButtonStyle">@style/NeutralButtonStyle</item>
|
||||
<item name="android:textColorAlertDialogListItem">@color/primary_dark</item>
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
<item name="android:textColorSecondary">@color/primary_light</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.Dialog.Night" parent="Theme.AppCompat.DayNight.Dialog.Alert">
|
||||
<item name="colorAccent">@color/accent</item>
|
||||
<item name="android:textColorPrimary">@color/white</item>
|
||||
<item name="buttonBarNegativeButtonStyle">@style/NegativeButtonStyle</item>
|
||||
<item name="buttonBarPositiveButtonStyle">@style/PositiveButtonStyle</item>
|
||||
<item name="buttonBarNeutralButtonStyle">@style/NeutralButtonStyle</item>
|
||||
<item name="android:textColorAlertDialogListItem">@color/white</item>
|
||||
<item name="android:windowBackground">@color/cardview_dark_background</item>
|
||||
<item name="android:textColorSecondary">@color/primary_light</item>
|
||||
</style>
|
||||
|
||||
<style name="NegativeButtonStyle" parent="Widget.AppCompat.Button.ButtonBar.AlertDialog">
|
||||
<item name="android:textColor">@color/accent</item>
|
||||
</style>
|
||||
|
||||
<style name="PositiveButtonStyle" parent="Widget.AppCompat.Button.ButtonBar.AlertDialog">
|
||||
<item name="android:textColor">@color/accent</item>
|
||||
</style>
|
||||
|
||||
<style name="NeutralButtonStyle" parent="Widget.AppCompat.Button.ButtonBar.AlertDialog">
|
||||
<item name="android:textColor">@color/accent</item>
|
||||
</style>
|
||||
|
||||
<style name="AddNoteDialogStyle" parent="Theme.AppCompat.Dialog">
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark</item>
|
||||
<item name="colorPrimary">@color/primary</item>
|
||||
<item name="android:textColor">#000000</item>
|
||||
<item name="android:editTextColor">#000000</item>
|
||||
<item name="android:textColorHint">@color/textDarkTertiary</item>
|
||||
<item name="android:windowFullscreen">false</item>
|
||||
<item name="android:windowIsFloating">false</item>
|
||||
<item name="android:windowBackground">@color/white</item>
|
||||
</style>
|
||||
|
||||
<style name="AddNoteDialogStyle.Night" parent="Theme.AppCompat.Dialog">
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark</item>
|
||||
<item name="colorPrimary">@color/primary</item>
|
||||
<item name="android:textColor">#ffffff</item>
|
||||
<item name="android:editTextColor">#ffffff</item>
|
||||
<item name="android:textColorHint">@color/grey</item>
|
||||
<item name="android:windowFullscreen">false</item>
|
||||
<item name="android:windowIsFloating">false</item>
|
||||
<item name="android:windowBackground">@color/cardview_dark_background</item>
|
||||
</style>
|
||||
|
||||
<style name="no_list_content_text" parent="TextAppearance.AppCompat">
|
||||
<style name="no_list_content_text" parent="TextAppearance.KiwixTheme.Headline6">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:textSize">20sp</item>
|
||||
<item name="android:textColor">@color/grey</item>
|
||||
<item name="android:visibility">gone</item>
|
||||
<item name="layout_constraintLeft_toLeftOf">parent</item>
|
||||
<item name="layout_constraintRight_toRightOf">parent</item>
|
||||
@ -163,8 +44,8 @@
|
||||
<item name="layout_constraintBottom_toBottomOf">parent</item>
|
||||
</style>
|
||||
|
||||
<style name="KiwixButtonStyle" parent="Widget.MaterialComponents.Button">
|
||||
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Medium</item>
|
||||
</style>
|
||||
<style name="list_item_title" parent="TextAppearance.KiwixTheme.Subtitle1" />
|
||||
|
||||
<style name="list_item_body" parent="TextAppearance.KiwixTheme.Subtitle2" />
|
||||
|
||||
</resources>
|
||||
|
78
core/src/main/res/values/themes.xml
Normal file
78
core/src/main/res/values/themes.xml
Normal file
@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<!--Top level theme to be used in AndroidManifest.xml-->
|
||||
<style name="KiwixTheme" parent="Base.KiwixTheme" />
|
||||
|
||||
<!--Base custom theme which will be shared between both light and dark theme variants-->
|
||||
<style name="Base.KiwixTheme" parent="Base.MaterialThemeBuilder">
|
||||
<!--Material color attributes -->
|
||||
|
||||
<!--colorPrimary colors map to components and elements, such as app bars and buttons. -->
|
||||
<!--colorSecondary colors are most often used as accents on components, such as FABs and -->
|
||||
<!--selection controls.-->
|
||||
<item name="colorPrimary">@color/color_primary</item>
|
||||
<item name="colorPrimaryVariant">?colorPrimary</item>
|
||||
<item name="colorSecondary">?colorPrimary</item>
|
||||
<item name="colorSecondaryVariant">?colorPrimary</item>
|
||||
|
||||
<!--colorBackground appears behind scrollable content and is used for the default window-->
|
||||
<!--background. colorSurface is mapped to the surface of components such as cards, sheets-->
|
||||
<!--and menus. colorError is used to indicate an error state for components such as-->
|
||||
<!--text fields.-->
|
||||
<item name="colorSurface">@color/color_surface</item>
|
||||
<item name="android:colorBackground">?colorSurface</item>
|
||||
<item name="colorError">@color/color_error</item>
|
||||
|
||||
<!--"On" colors define how text, icons and strokes are colored in relation to the surface-->
|
||||
<!--on which they appear.-->
|
||||
<item name="colorOnPrimary">@color/color_on_primary</item>
|
||||
<item name="colorOnSecondary">?colorOnPrimary</item>
|
||||
<item name="colorOnSurface">@color/color_on_surface</item>
|
||||
<item name="colorOnBackground">?colorOnSurface</item>
|
||||
<item name="colorOnError">@color/color_on_error</item>
|
||||
|
||||
<!--Material type attributes-->
|
||||
<item name="textAppearanceHeadline1">@style/TextAppearance.KiwixTheme.Headline1</item>
|
||||
<item name="textAppearanceHeadline2">@style/TextAppearance.KiwixTheme.Headline2</item>
|
||||
<item name="textAppearanceHeadline3">@style/TextAppearance.KiwixTheme.Headline3</item>
|
||||
<item name="textAppearanceHeadline4">@style/TextAppearance.KiwixTheme.Headline4</item>
|
||||
<item name="textAppearanceHeadline5">@style/TextAppearance.KiwixTheme.Headline5</item>
|
||||
<item name="textAppearanceHeadline6">@style/TextAppearance.KiwixTheme.Headline6</item>
|
||||
<item name="textAppearanceSubtitle1">@style/TextAppearance.KiwixTheme.Subtitle1</item>
|
||||
<item name="textAppearanceSubtitle2">@style/TextAppearance.KiwixTheme.Subtitle2</item>
|
||||
<item name="textAppearanceBody1">@style/TextAppearance.KiwixTheme.Body1</item>
|
||||
<item name="textAppearanceBody2">@style/TextAppearance.KiwixTheme.Body2</item>
|
||||
<item name="textAppearanceButton">@style/TextAppearance.KiwixTheme.Button</item>
|
||||
<item name="textAppearanceCaption">@style/TextAppearance.KiwixTheme.Caption</item>
|
||||
<item name="textAppearanceOverline">@style/TextAppearance.KiwixTheme.Overline</item>
|
||||
|
||||
<!--Material shape attributes-->
|
||||
<item name="shapeAppearanceSmallComponent">@style/ShapeAppearance.KiwixTheme.SmallComponent
|
||||
</item>
|
||||
<item name="shapeAppearanceMediumComponent">@style/ShapeAppearance.KiwixTheme.MediumComponent
|
||||
</item>
|
||||
<item name="shapeAppearanceLargeComponent">@style/ShapeAppearance.KiwixTheme.LargeComponent
|
||||
</item>
|
||||
|
||||
<!--Component styles-->
|
||||
<item name="materialAlertDialogTheme">@style/ThemeOverlay.MaterialComponents.Dialog.Alert</item>
|
||||
<item name="bottomSheetDialogTheme">@style/ThemeOverlay.KiwixTheme.BottomSheetDialog</item>
|
||||
<item name="navigationViewStyle">@style/Widget.KiwixTheme.NavigationView</item>
|
||||
<item name="toolbarStyle">@style/Widget.KiwixTheme.Toolbar</item>
|
||||
<item name="tabStyle">@style/Widget.KiwixTheme.TabLayout</item>
|
||||
</style>
|
||||
|
||||
<style name="Base.MaterialThemeBuilder" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
|
||||
<item name="android:statusBarColor" tools:ignore="NewApi">@color/black</item>
|
||||
<item name="actionModeBackground">@color/actionModeBackground</item>
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
|
||||
<!--Remap legacy AppCompat attributes to MaterialComponent attributes-->
|
||||
<item name="colorPrimaryDark">?colorPrimaryVariant</item>
|
||||
<item name="colorAccent">?colorSecondary</item>
|
||||
|
||||
</style>
|
||||
|
||||
</resources>
|
76
core/src/main/res/values/type.xml
Normal file
76
core/src/main/res/values/type.xml
Normal file
@ -0,0 +1,76 @@
|
||||
<resources>
|
||||
|
||||
<!--Typography-->
|
||||
|
||||
<!--Material’s type system supports 13 categories that, when combined, form the typescale. -->
|
||||
<!--This typescale is evident in the variety of text styles and sizes that appear on screen, -->
|
||||
<!--ranging from body copy to buttons. Type appears across the UI, in places such as in -->
|
||||
<!--components and on surfaces.-->
|
||||
|
||||
<!--These styles should be used throughout your app when creating text views so all your -->
|
||||
<!--text is consistently styled and easily updated if design or product needs change. Each -->
|
||||
<!--style in the type scale can be customized by defining a style and overriding that -->
|
||||
<!--style's Material Theme attribute (?textAppearanceHeadline1, ?textAppearanceBody2, etc.) -->
|
||||
<!--in your app's theme. In this project, type attributes have already been overridden in -->
|
||||
<!--themes.xml and are set to the styles in this file, type.xml. These ?textAppearance* -->
|
||||
<!--theme attributes should be used in your layouts to set a TextView’s appearance instead -->
|
||||
<!--of fully qualified style references and in favor of manually setting text properties.-->
|
||||
|
||||
<!--Type on Android is themed by defining a custom TextAppearance for each type scale style. -->
|
||||
<!--Use standard TextAppearance attributes such as textSize, textColor, fontFamily, -->
|
||||
<!--letterSpacing, etc. to define a custom appearance for each and see how they are -->
|
||||
<!--applied globally across your app.-->
|
||||
|
||||
<style name="TextAppearance.KiwixTheme.Headline1" parent="TextAppearance.MaterialComponents.Headline1">
|
||||
<!--Your custom type style here-->
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.KiwixTheme.Headline2" parent="TextAppearance.MaterialComponents.Headline2">
|
||||
<!--Your custom type style here-->
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.KiwixTheme.Headline3" parent="TextAppearance.MaterialComponents.Headline3">
|
||||
<!--Your custom type style here-->
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.KiwixTheme.Headline4" parent="TextAppearance.MaterialComponents.Headline4">
|
||||
<!--Your custom type style here-->
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.KiwixTheme.Headline5" parent="TextAppearance.MaterialComponents.Headline5">
|
||||
<!--Your custom type style here-->
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.KiwixTheme.Headline6" parent="TextAppearance.MaterialComponents.Headline6">
|
||||
<!--Your custom type style here-->
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.KiwixTheme.Subtitle1" parent="TextAppearance.MaterialComponents.Subtitle1">
|
||||
<!--Your custom type style here-->
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.KiwixTheme.Subtitle2" parent="TextAppearance.MaterialComponents.Subtitle2">
|
||||
<!--Your custom type style here-->
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.KiwixTheme.Body1" parent="TextAppearance.MaterialComponents.Body1">
|
||||
<!--Your custom type style here-->
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.KiwixTheme.Body2" parent="TextAppearance.MaterialComponents.Body2">
|
||||
<!--Your custom type style here-->
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.KiwixTheme.Button" parent="TextAppearance.MaterialComponents.Button">
|
||||
<!--Your custom type style here-->
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.KiwixTheme.Caption" parent="TextAppearance.MaterialComponents.Caption">
|
||||
<!--Your custom type style here-->
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.KiwixTheme.Overline" parent="TextAppearance.MaterialComponents.Overline">
|
||||
<!--Your custom type style here-->
|
||||
</style>
|
||||
|
||||
</resources>
|
@ -10,7 +10,7 @@
|
||||
<activity
|
||||
android:name=".splash.CustomSplashActivity"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme.Launcher">
|
||||
android:theme="@style/ThemeOverlay.KiwixTheme.Launcher">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
package org.kiwix.kiwixmobile.custom.download.effects
|
||||
|
||||
import android.app.Activity
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import org.kiwix.kiwixmobile.core.base.SideEffect
|
||||
import org.kiwix.kiwixmobile.core.downloader.Downloader
|
||||
import org.kiwix.kiwixmobile.core.entity.LibraryNetworkEntity.Book
|
||||
@ -26,7 +26,7 @@ import org.kiwix.kiwixmobile.custom.BuildConfig
|
||||
import javax.inject.Inject
|
||||
|
||||
data class DownloadCustom @Inject constructor(val downloader: Downloader) : SideEffect<Unit> {
|
||||
override fun invokeWith(activity: Activity) {
|
||||
override fun invokeWith(activity: AppCompatActivity) {
|
||||
downloader.download(emptyBook(id = "custom", url = BuildConfig.ZIM_URL))
|
||||
}
|
||||
|
||||
|
@ -18,14 +18,14 @@
|
||||
|
||||
package org.kiwix.kiwixmobile.custom.download.effects
|
||||
|
||||
import android.app.Activity
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import org.kiwix.kiwixmobile.core.base.SideEffect
|
||||
import org.kiwix.kiwixmobile.core.extensions.ActivityExtensions.start
|
||||
import org.kiwix.kiwixmobile.custom.main.CustomMainActivity
|
||||
import javax.inject.Inject
|
||||
|
||||
class FinishAndStartMain @Inject constructor() : SideEffect<Unit> {
|
||||
override fun invokeWith(activity: Activity) {
|
||||
override fun invokeWith(activity: AppCompatActivity) {
|
||||
activity.finish()
|
||||
activity.start<CustomMainActivity>()
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
package org.kiwix.kiwixmobile.custom.download.effects
|
||||
|
||||
import android.app.Activity
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import org.kiwix.kiwixmobile.core.base.SideEffect
|
||||
import org.kiwix.kiwixmobile.core.settings.StorageCalculator
|
||||
@ -29,7 +29,7 @@ class SetPreferredStorageWithMostSpace @Inject constructor(
|
||||
private val storageCalculator: StorageCalculator,
|
||||
private val sharedPreferenceUtil: SharedPreferenceUtil
|
||||
) : SideEffect<Unit> {
|
||||
override fun invokeWith(activity: Activity) {
|
||||
override fun invokeWith(activity: AppCompatActivity) {
|
||||
ContextCompat.getExternalFilesDirs(activity, null)
|
||||
.filterNotNull()
|
||||
.maxBy(storageCalculator::availableBytes)
|
||||
|
Loading…
x
Reference in New Issue
Block a user