Merge branch 'crash_fixes' into 'master'

Color theme, and prevent crash

See merge request pixeldroid/PixelDroid!440
This commit is contained in:
Matthieu 2022-07-10 13:10:51 +00:00
commit e560a78b44
73 changed files with 1230 additions and 246 deletions

View File

@ -28,7 +28,7 @@ android {
applicationId "org.pixeldroid.app"
minSdkVersion 23
targetSdkVersion 32
versionCode 15
versionCode 16
versionName "1.0.beta" + versionCode
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@ -110,30 +110,30 @@ dependencies {
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.4.2'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.0'
implementation "androidx.browser:browser:1.4.0"
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.4.2'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.0'
implementation 'androidx.paging:paging-runtime-ktx:3.1.1'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-savedstate:2.4.1'
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.4.1"
implementation "androidx.lifecycle:lifecycle-common-java8:2.4.1"
implementation "androidx.annotation:annotation:1.3.0"
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.0'
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.5.0"
implementation "androidx.lifecycle:lifecycle-common-java8:2.5.0"
implementation "androidx.annotation:annotation:1.4.0"
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation "androidx.activity:activity-ktx:1.4.0"
implementation 'androidx.fragment:fragment-ktx:1.4.1'
implementation "androidx.activity:activity-ktx:1.5.0"
implementation 'androidx.fragment:fragment-ktx:1.5.0'
implementation 'androidx.work:work-runtime-ktx:2.7.1'
implementation 'androidx.media2:media2-widget:1.2.1'
implementation 'androidx.media2:media2-player:1.2.1'
// Use the most recent version of CameraX
def cameraX_version = '1.1.0-rc02'
def cameraX_version = '1.1.0'
implementation "androidx.camera:camera-core:$cameraX_version"
implementation "androidx.camera:camera-camera2:$cameraX_version"
// CameraX Lifecycle library
@ -159,45 +159,45 @@ dependencies {
implementation 'com.google.android.material:material:1.6.1'
//Dagger (dependency injection)
implementation 'com.google.dagger:dagger-android:2.40.5'
implementation 'com.google.dagger:dagger-android-support:2.40.5'
implementation 'com.google.dagger:dagger-android:2.42'
implementation 'com.google.dagger:dagger-android-support:2.42'
// if you use the support libraries
kapt 'com.google.dagger:dagger-android-processor:2.40.5'
kapt 'com.google.dagger:dagger-compiler:2.40.5'
kapt 'com.google.dagger:dagger-android-processor:2.42'
kapt 'com.google.dagger:dagger-compiler:2.42'
implementation 'com.squareup.okhttp3:okhttp:4.9.2'
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.retrofit2:adapter-rxjava3:2.9.0'
implementation 'io.reactivex.rxjava3:rxjava:3.1.3'
implementation 'io.reactivex.rxjava3:rxjava:3.1.5'
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
implementation 'com.github.connyduck:sparkbutton:4.1.0'
implementation 'info.androidhive:imagefilters:1.0.7'
implementation 'com.github.yalantis:ucrop:2.2.6-native'
implementation 'com.github.yalantis:ucrop:2.2.8-native'
implementation('com.github.bumptech.glide:glide:4.12.0') {
implementation('com.github.bumptech.glide:glide:4.13.2') {
exclude group: "com.android.support"
}
implementation 'com.github.bumptech.glide:okhttp-integration:4.12.0'
implementation('com.github.bumptech.glide:recyclerview-integration:4.12.0') {
implementation 'com.github.bumptech.glide:okhttp-integration:4.13.2'
implementation('com.github.bumptech.glide:recyclerview-integration:4.13.2') {
// Excludes the support library because it's already included by Glide.
transitive = false
}
kapt 'com.github.bumptech.glide:compiler:4.12.0'
kapt 'com.github.bumptech.glide:compiler:4.13.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.mikepenz:materialdrawer:8.4.4'
implementation 'com.mikepenz:materialdrawer:9.0.1'
// Add for NavController support
implementation 'com.mikepenz:materialdrawer-nav:8.4.4'
implementation 'com.mikepenz:materialdrawer-nav:9.0.1'
//iconics
implementation 'com.mikepenz:iconics-core:5.3.3'
implementation 'com.mikepenz:materialdrawer-iconics:8.4.2'
implementation 'com.mikepenz:iconics-views:5.3.3'
implementation 'com.mikepenz:iconics-core:5.3.4'
implementation 'com.mikepenz:materialdrawer-iconics:9.0.1'
implementation 'com.mikepenz:iconics-views:5.3.4'
implementation 'com.mikepenz:google-material-typeface:4.0.0.2-kotlin@aar'
@ -214,7 +214,7 @@ dependencies {
//stagingImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
androidTestImplementation 'androidx.work:work-testing:2.7.1'
testImplementation 'com.github.tomakehurst:wiremock-jre8:2.32.0'
testImplementation 'com.github.tomakehurst:wiremock-jre8:2.33.2'
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
testImplementation 'junit:junit:4.13.2'
testImplementation "androidx.room:room-testing:$room_version"

View File

@ -86,4 +86,37 @@
static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String);
static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
static void throwUninitializedPropertyAccessException(java.lang.String);
}
}
##---------------Begin: proguard configuration for Gson ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature
# For using GSON @Expose annotation
-keepattributes *Annotation*
# Gson specific classes
-dontwarn sun.misc.**
#-keep class com.google.gson.stream.** { *; }
# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { <fields>; }
# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}
# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
##---------------End: proguard configuration for Gson ----------

View File

@ -41,7 +41,7 @@
android:parentActivityName=".MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity " />
android:value=".MainActivity" />
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>

View File

@ -10,22 +10,22 @@ import android.view.View
import android.view.inputmethod.InputMethodManager
import androidx.lifecycle.lifecycleScope
import androidx.paging.ExperimentalPagingApi
import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkManager
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.async
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.launch
import org.pixeldroid.app.databinding.ActivityLoginBinding
import org.pixeldroid.app.utils.*
import org.pixeldroid.app.utils.api.PixelfedAPI
import org.pixeldroid.app.utils.api.objects.*
import org.pixeldroid.app.utils.api.objects.Application
import org.pixeldroid.app.utils.api.objects.Instance
import org.pixeldroid.app.utils.api.objects.NodeInfo
import org.pixeldroid.app.utils.db.addUser
import org.pixeldroid.app.utils.db.storeInstance
import kotlinx.coroutines.*
import org.pixeldroid.app.utils.notificationsWorker.NotificationsWorker
import org.pixeldroid.app.utils.notificationsWorker.makeChannelGroupId
import org.pixeldroid.app.utils.notificationsWorker.makeNotificationChannels
import retrofit2.HttpException
import java.io.IOException
import java.lang.IllegalArgumentException
import java.lang.NullPointerException
/**
Overview of the flow of the login process: (boxes are requests done in parallel,
@ -42,7 +42,7 @@ since they do not depend on each other)
*/
class LoginActivity : BaseActivity() {
class LoginActivity : BaseThemedWithoutBarActivity() {
companion object {
private const val PACKAGE_ID = BuildConfig.APPLICATION_ID

View File

@ -6,6 +6,7 @@ import android.graphics.drawable.Drawable
import android.net.Uri
import android.os.Bundle
import android.util.Log
import android.view.MenuItem
import android.view.View
import android.widget.ImageView
import androidx.appcompat.app.AppCompatActivity
@ -17,9 +18,9 @@ import androidx.paging.ExperimentalPagingApi
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager2.adapter.FragmentStateAdapter
import androidx.viewpager2.widget.ViewPager2
import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback
import com.bumptech.glide.Glide
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator
import com.google.android.material.bottomnavigation.BottomNavigationView
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.materialdrawer.iconics.iconicsIcon
import com.mikepenz.materialdrawer.model.PrimaryDrawerItem
@ -39,9 +40,8 @@ import org.pixeldroid.app.posts.feeds.cachedFeeds.postFeeds.PostFeedFragment
import org.pixeldroid.app.profile.ProfileActivity
import org.pixeldroid.app.searchDiscover.SearchDiscoverFragment
import org.pixeldroid.app.settings.SettingsActivity
import org.pixeldroid.app.utils.BaseActivity
import org.pixeldroid.app.utils.BaseThemedWithoutBarActivity
import org.pixeldroid.app.utils.db.addUser
import org.pixeldroid.app.utils.notificationsWorker.enablePullNotifications
import org.pixeldroid.app.utils.db.entities.HomeStatusDatabaseEntity
import org.pixeldroid.app.utils.db.entities.PublicFeedStatusDatabaseEntity
import org.pixeldroid.app.utils.db.entities.UserDatabaseEntity
@ -49,12 +49,13 @@ import org.pixeldroid.app.utils.hasInternet
import org.pixeldroid.app.utils.notificationsWorker.NotificationsWorker.Companion.INSTANCE_NOTIFICATION_TAG
import org.pixeldroid.app.utils.notificationsWorker.NotificationsWorker.Companion.SHOW_NOTIFICATION_TAG
import org.pixeldroid.app.utils.notificationsWorker.NotificationsWorker.Companion.USER_NOTIFICATION_TAG
import org.pixeldroid.app.utils.notificationsWorker.enablePullNotifications
import org.pixeldroid.app.utils.notificationsWorker.removeNotificationChannelsFromAccount
import retrofit2.HttpException
import java.io.IOException
class MainActivity : BaseActivity() {
class MainActivity : BaseThemedWithoutBarActivity() {
private lateinit var header: AccountHeaderView
private var user: UserDatabaseEntity? = null
@ -68,7 +69,6 @@ class MainActivity : BaseActivity() {
@OptIn(ExperimentalPagingApi::class)
override fun onCreate(savedInstanceState: Bundle?) {
setTheme(R.style.AppTheme_NoActionBar)
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
@ -142,11 +142,12 @@ class MainActivity : BaseActivity() {
}
private fun setupDrawer() {
binding.mainDrawerButton.setOnClickListener{
binding.drawerLayout.open()
binding.mainDrawerButton.setOnClickListener{
binding.drawerLayout.openDrawer(binding.drawer)
}
header = AccountHeaderView(this).apply {
attachToSliderView(binding.drawer)
headerBackgroundScaleType = ImageView.ScaleType.CENTER_CROP
currentHiddenInList = true
onAccountHeaderListener = { _: View?, profile: IProfile, current: Boolean ->
@ -158,7 +159,6 @@ class MainActivity : BaseActivity() {
descriptionRes = R.string.add_account_description
iconicsIcon = GoogleMaterial.Icon.gmd_add
}, 0)
attachToSliderView(binding.drawer)
dividerBelowHeader = false
closeDrawerOnProfileListClick = true
}
@ -294,7 +294,7 @@ class MainActivity : BaseActivity() {
isIconTinted = true
}
.apply(block)
}
}
private fun fillDrawerAccountInfo(account: String) {
val users = db.userDao().getAll().toMutableList()
@ -353,32 +353,57 @@ class MainActivity : BaseActivity() {
return tab_array.size
}
}
binding.tabs.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab?){}
override fun onTabUnselected(tab: TabLayout.Tab?) {}
override fun onTabReselected(tab: TabLayout.Tab?) {
tab?.position?.let { position ->
val page =
//No clue why this works but it does. F to pay respects
supportFragmentManager.findFragmentByTag("f$position")
(page as? CachedFeedFragment<*>)?.onTabReClicked()
binding.viewPager.registerOnPageChangeCallback(object : OnPageChangeCallback() {
override fun onPageSelected(position: Int) {
val selected = when(position){
0 -> R.id.page_1
1 -> R.id.page_2
2 -> R.id.page_3
3 -> R.id.page_4
4 -> R.id.page_5
else -> null
}
if (selected != null) {
binding.tabs.selectedItemId = selected
}
super.onPageSelected(position)
}
})
TabLayoutMediator(binding.tabs, binding.viewPager) { tab, position ->
tab.icon = ContextCompat.getDrawable(applicationContext,
when(position){
0 -> R.drawable.ic_home_white_24dp
1 -> R.drawable.ic_search_white_24dp
2 -> R.drawable.photo_camera
3 -> R.drawable.ic_heart
4 -> R.drawable.ic_filter_black_24dp
else -> throw IllegalArgumentException()
})
}.attach()
fun MenuItem.itemPos(): Int? {
return when(itemId){
R.id.page_1 -> 0
R.id.page_2 -> 1
R.id.page_3 -> 2
R.id.page_4 -> 3
R.id.page_5 -> 4
else -> null
}
}
binding.tabs.setOnItemSelectedListener {item ->
item.itemPos()?.let {
binding.viewPager.currentItem = it
true
} ?: false
}
binding.tabs.setOnItemReselectedListener { item ->
item.itemPos()?.let { position ->
val page =
//No clue why this works but it does. F to pay respects
supportFragmentManager.findFragmentByTag("f$position")
(page as? CachedFeedFragment<*>)?.onTabReClicked()
}
}
}
fun BottomNavigationView.uncheckAllItems() {
menu.setGroupCheckable(0, true, false)
for (i in 0 until menu.size()) {
menu.getItem(i).isChecked = false
}
menu.setGroupCheckable(0, true, true)
}
/**

View File

@ -2,7 +2,9 @@ package org.pixeldroid.app.postCreation
import android.app.Activity
import android.app.AlertDialog
import android.content.*
import android.content.ContentResolver
import android.content.ContentValues
import android.content.Intent
import android.media.MediaScannerConnection
import android.net.Uri
import android.os.*
@ -26,7 +28,6 @@ import androidx.lifecycle.repeatOnLifecycle
import androidx.recyclerview.widget.RecyclerView
import com.arthenica.ffmpegkit.*
import com.google.android.material.snackbar.Snackbar
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.launch
import org.pixeldroid.app.R
import org.pixeldroid.app.databinding.ActivityPostCreationBinding
@ -34,7 +35,7 @@ import org.pixeldroid.app.postCreation.camera.CameraActivity
import org.pixeldroid.app.postCreation.carousel.CarouselItem
import org.pixeldroid.app.postCreation.photoEdit.PhotoEditActivity
import org.pixeldroid.app.postCreation.photoEdit.VideoEditActivity
import org.pixeldroid.app.utils.BaseActivity
import org.pixeldroid.app.utils.BaseThemedWithoutBarActivity
import org.pixeldroid.app.utils.db.entities.InstanceDatabaseEntity
import org.pixeldroid.app.utils.db.entities.UserDatabaseEntity
import org.pixeldroid.app.utils.ffmpegSafeUri
@ -58,7 +59,7 @@ data class PhotoData(
var videoEncodeProgress: Int? = null,
)
class PostCreationActivity : BaseActivity() {
class PostCreationActivity : BaseThemedWithoutBarActivity() {
private var user: UserDatabaseEntity? = null
private lateinit var instance: InstanceDatabaseEntity

View File

@ -3,13 +3,12 @@ package org.pixeldroid.app.postCreation.camera
import android.content.Intent
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import org.pixeldroid.app.MainActivity
import org.pixeldroid.app.R
import org.pixeldroid.app.utils.BaseActivity
import org.pixeldroid.app.utils.BaseThemedWithBarActivity
class CameraActivity : BaseActivity() {
class CameraActivity : BaseThemedWithBarActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_camera)
@ -32,7 +31,7 @@ class CameraActivity : BaseActivity() {
* [org.pixeldroid.app.postCreation.PostCreationActivity] instead of "returning" to a non-existent
* [org.pixeldroid.app.postCreation.PostCreationActivity]
*/
class CameraActivityShortcut : AppCompatActivity() {
class CameraActivityShortcut : BaseThemedWithBarActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_camera)

View File

@ -256,8 +256,7 @@ class ImageCarousel(
if(value){
recyclerView.layoutManager = CarouselLinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
binding.btnNext.visibility = VISIBLE
binding.btnPrevious.visibility = VISIBLE
showNavigationButtons = showNavigationButtons
binding.editMediaDescriptionLayout.visibility = if(editingMediaDescription) VISIBLE else INVISIBLE
tvCaption.visibility = if(editingMediaDescription) INVISIBLE else VISIBLE
@ -395,7 +394,7 @@ class ImageCarousel(
showNavigationButtons = getBoolean(
R.styleable.ImageCarousel_showNavigationButtons,
true
false
)
layoutCarousel = getBoolean(
@ -561,6 +560,7 @@ class ImageCarousel(
initOnScrollStateChange()
}
showNavigationButtons = data.size != 1
}
fun updateProgress(progress: Int?, position: Int, error: Boolean){

View File

@ -5,10 +5,12 @@ import android.app.AlertDialog
import android.content.Intent
import android.content.pm.PackageManager
import android.graphics.Bitmap
import android.graphics.Color
import android.graphics.Point
import android.graphics.drawable.BitmapDrawable
import android.net.Uri
import android.os.Bundle
import android.util.TypedValue
import android.view.Menu
import android.view.MenuItem
import android.view.View.GONE
@ -17,17 +19,19 @@ import android.widget.Toast
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import com.bumptech.glide.Glide
import com.google.android.material.color.MaterialColors
import com.google.android.material.snackbar.Snackbar
import org.pixeldroid.app.R
import org.pixeldroid.app.databinding.ActivityPhotoEditBinding
import org.pixeldroid.app.postCreation.PostCreationActivity
import org.pixeldroid.app.utils.BaseActivity
import com.yalantis.ucrop.UCrop
import com.zomato.photofilters.imageprocessors.Filter
import com.zomato.photofilters.imageprocessors.subfilters.BrightnessSubFilter
import com.zomato.photofilters.imageprocessors.subfilters.ContrastSubFilter
import com.zomato.photofilters.imageprocessors.subfilters.SaturationSubfilter
import org.pixeldroid.app.R
import org.pixeldroid.app.databinding.ActivityPhotoEditBinding
import org.pixeldroid.app.postCreation.PostCreationActivity
import org.pixeldroid.app.utils.BaseThemedWithBarActivity
import org.pixeldroid.app.utils.bitmapFromUri
import org.pixeldroid.app.utils.getColorFromAttr
import java.io.File
import java.io.IOException
import java.io.OutputStream
@ -44,7 +48,7 @@ private val REQUIRED_PERMISSIONS = arrayOf(
android.Manifest.permission.WRITE_EXTERNAL_STORAGE
)
class PhotoEditActivity : BaseActivity() {
class PhotoEditActivity : BaseThemedWithBarActivity() {
var saving: Boolean = false
private val BITMAP_CONFIG = Bitmap.Config.ARGB_8888
@ -265,8 +269,10 @@ class PhotoEditActivity : BaseActivity() {
val file = File.createTempFile("temp_crop_img", ".png", cacheDir)
val options: UCrop.Options = UCrop.Options().apply {
setStatusBarColor(resources.getColor(R.color.colorPrimaryDark, theme))
setActiveControlsWidgetColor(resources.getColor(R.color.colorButtonBg, theme))
setStatusBarColor(this@PhotoEditActivity.getColorFromAttr(R.attr.colorPrimaryDark))
setToolbarWidgetColor(this@PhotoEditActivity.getColorFromAttr(R.attr.colorOnSurface))
setToolbarColor(this@PhotoEditActivity.getColorFromAttr(R.attr.colorSurface))
setActiveControlsWidgetColor(this@PhotoEditActivity.getColorFromAttr(R.attr.colorPrimary))
}
val uCrop: UCrop = UCrop.of(initialUri!!, Uri.fromFile(file)).withOptions(options)
uCrop.start(this)

View File

@ -10,6 +10,7 @@ import androidx.recyclerview.widget.RecyclerView
import org.pixeldroid.app.R
import org.pixeldroid.app.databinding.ThumbnailListItemBinding
import com.zomato.photofilters.utils.ThumbnailItem
import org.pixeldroid.app.utils.getColorFromAttr
class ThumbnailAdapter (private val context: Context,
private val tbItemList: List<ThumbnailItem>,
@ -43,9 +44,9 @@ class ThumbnailAdapter (private val context: Context,
holder.filterName.text = tbItem.filterName
if(selectedIndex == position)
holder.filterName.setTextColor(ContextCompat.getColor(context, R.color.filterLabelSelected))
holder.filterName.setTextColor(context.getColorFromAttr(R.attr.colorPrimary))
else
holder.filterName.setTextColor(ContextCompat.getColor(context, R.color.filterLabelNormal))
holder.filterName.setTextColor(context.getColorFromAttr(R.attr.colorOnBackground))
}
class MyViewHolder(itemBinding: ThumbnailListItemBinding): RecyclerView.ViewHolder(itemBinding.root) {

View File

@ -28,12 +28,12 @@ import org.pixeldroid.app.R
import org.pixeldroid.app.databinding.ActivityVideoEditBinding
import org.pixeldroid.app.postCreation.PostCreationActivity
import org.pixeldroid.app.postCreation.carousel.dpToPx
import org.pixeldroid.app.utils.BaseActivity
import org.pixeldroid.app.utils.BaseThemedWithBarActivity
import org.pixeldroid.app.utils.ffmpegSafeUri
import java.io.File
class VideoEditActivity : BaseActivity() {
class VideoEditActivity : BaseThemedWithBarActivity() {
private lateinit var mediaPlayer: MediaPlayer
private var videoPosition: Int = -1

View File

@ -6,7 +6,6 @@ import android.content.pm.ActivityInfo
import android.media.AudioManager.STREAM_MUSIC
import android.os.Bundle
import androidx.core.net.toUri
import androidx.core.view.ViewCompat
import androidx.core.view.WindowCompat.getInsetsController
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.WindowInsetsControllerCompat
@ -15,9 +14,9 @@ import androidx.media2.common.MediaMetadata
import androidx.media2.common.UriMediaItem
import androidx.media2.player.MediaPlayer
import org.pixeldroid.app.databinding.ActivityMediaviewerBinding
import org.pixeldroid.app.utils.BaseActivity
import org.pixeldroid.app.utils.BaseThemedWithoutBarActivity
class MediaViewerActivity : BaseActivity() {
class MediaViewerActivity : BaseThemedWithoutBarActivity() {
private lateinit var mediaPlayer: MediaPlayer
private lateinit var binding: ActivityMediaviewerBinding

View File

@ -12,7 +12,7 @@ import androidx.lifecycle.lifecycleScope
import org.pixeldroid.app.R
import org.pixeldroid.app.databinding.ActivityPostBinding
import org.pixeldroid.app.databinding.CommentBinding
import org.pixeldroid.app.utils.BaseActivity
import org.pixeldroid.app.utils.BaseThemedWithBarActivity
import org.pixeldroid.app.utils.api.PixelfedAPI
import org.pixeldroid.app.utils.api.objects.Mention
import org.pixeldroid.app.utils.api.objects.Status
@ -23,7 +23,7 @@ import org.pixeldroid.app.utils.displayDimensionsInPx
import retrofit2.HttpException
import java.io.IOException
class PostActivity : BaseActivity() {
class PostActivity : BaseThemedWithBarActivity() {
lateinit var domain : String
private lateinit var binding: ActivityPostBinding

View File

@ -5,12 +5,12 @@ import android.view.View
import androidx.lifecycle.lifecycleScope
import org.pixeldroid.app.R
import org.pixeldroid.app.databinding.ActivityReportBinding
import org.pixeldroid.app.utils.BaseActivity
import org.pixeldroid.app.utils.BaseThemedWithBarActivity
import org.pixeldroid.app.utils.api.objects.Status
import retrofit2.HttpException
import java.io.IOException
class ReportActivity : BaseActivity() {
class ReportActivity : BaseThemedWithBarActivity() {
private lateinit var binding: ActivityReportBinding
@ -56,14 +56,14 @@ class ReportActivity : BaseActivity() {
private fun reportStatus(success: Boolean){
if(success){
binding.reportProgressBar.visibility = View.GONE
binding.reportButton.isEnabled = false
binding.reportButton.text = getString(R.string.reported)
binding.reportButton.visibility = View.VISIBLE
binding.reportButton.visibility = View.INVISIBLE
binding.reportSuccess.visibility = View.VISIBLE
} else {
binding.textInputLayout.error = getString(R.string.report_error)
binding.reportButton.visibility = View.VISIBLE
binding.textInputLayout.editText?.isEnabled = true
binding.reportProgressBar.visibility = View.GONE
binding.reportSuccess.visibility = View.GONE
}
}
}

View File

@ -3,11 +3,11 @@ package org.pixeldroid.app.posts.feeds.uncachedFeeds.hashtags
import android.os.Bundle
import org.pixeldroid.app.R
import org.pixeldroid.app.posts.feeds.uncachedFeeds.UncachedPostsFragment
import org.pixeldroid.app.utils.BaseActivity
import org.pixeldroid.app.utils.BaseThemedWithBarActivity
import org.pixeldroid.app.utils.api.objects.Tag.Companion.HASHTAG_TAG
class HashTagActivity : BaseActivity() {
class HashTagActivity : BaseThemedWithBarActivity() {
private var tagFragment = UncachedPostsFragment()
override fun onCreate(savedInstanceState: Bundle?) {

View File

@ -3,14 +3,14 @@ package org.pixeldroid.app.profile
import android.os.Bundle
import org.pixeldroid.app.R
import org.pixeldroid.app.posts.feeds.uncachedFeeds.accountLists.AccountListFragment
import org.pixeldroid.app.utils.BaseThemedWithBarActivity
import org.pixeldroid.app.utils.api.objects.Account
import org.pixeldroid.app.utils.api.objects.Account.Companion.ACCOUNT_ID_TAG
import org.pixeldroid.app.utils.api.objects.Account.Companion.ACCOUNT_TAG
import org.pixeldroid.app.utils.api.objects.Account.Companion.FOLLOWERS_TAG
import org.pixeldroid.app.utils.BaseActivity
class FollowsActivity : BaseActivity() {
class FollowsActivity : BaseThemedWithBarActivity() {
private var followsFragment = AccountListFragment()
override fun onCreate(savedInstanceState: Bundle?) {

View File

@ -6,10 +6,9 @@ import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.*
import android.widget.ImageView
import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.content.res.AppCompatResources
import androidx.constraintlayout.motion.widget.MotionLayout
import androidx.core.content.ContextCompat
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
@ -22,6 +21,8 @@ import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
import com.google.android.material.snackbar.Snackbar
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import org.pixeldroid.app.R
import org.pixeldroid.app.databinding.ActivityProfileBinding
import org.pixeldroid.app.databinding.FragmentProfilePostsBinding
@ -32,23 +33,19 @@ import org.pixeldroid.app.posts.feeds.uncachedFeeds.FeedViewModel
import org.pixeldroid.app.posts.feeds.uncachedFeeds.UncachedContentRepository
import org.pixeldroid.app.posts.feeds.uncachedFeeds.profile.ProfileContentRepository
import org.pixeldroid.app.posts.parseHTMLText
import org.pixeldroid.app.utils.BaseActivity
import org.pixeldroid.app.utils.BaseThemedWithBarActivity
import org.pixeldroid.app.utils.BlurHashDecoder
import org.pixeldroid.app.utils.ImageConverter
import org.pixeldroid.app.utils.api.PixelfedAPI
import org.pixeldroid.app.utils.api.objects.Account
import org.pixeldroid.app.utils.api.objects.Attachment
import org.pixeldroid.app.utils.api.objects.Status
import org.pixeldroid.app.utils.db.entities.UserDatabaseEntity
import org.pixeldroid.app.utils.openUrl
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import org.pixeldroid.app.databinding.ErrorLayoutBinding
import org.pixeldroid.app.postCreation.carousel.dpToPx
import org.pixeldroid.app.utils.BlurHashDecoder
import org.pixeldroid.app.utils.api.objects.Attachment
import retrofit2.HttpException
import java.io.IOException
class ProfileActivity : BaseActivity() {
class ProfileActivity : BaseThemedWithBarActivity() {
private lateinit var domain : String
private lateinit var accountId : String

View File

@ -12,10 +12,10 @@ import org.pixeldroid.app.R
import org.pixeldroid.app.posts.feeds.uncachedFeeds.UncachedPostsFragment
import org.pixeldroid.app.posts.feeds.uncachedFeeds.search.SearchAccountFragment
import org.pixeldroid.app.posts.feeds.uncachedFeeds.search.SearchHashtagFragment
import org.pixeldroid.app.utils.BaseThemedWithBarActivity
import org.pixeldroid.app.utils.api.objects.Results
import org.pixeldroid.app.utils.BaseActivity
class SearchActivity : BaseActivity() {
class SearchActivity : BaseThemedWithBarActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

View File

@ -5,9 +5,9 @@ import android.os.Bundle
import org.pixeldroid.app.BuildConfig
import org.pixeldroid.app.R
import org.pixeldroid.app.databinding.ActivityAboutBinding
import org.pixeldroid.app.utils.BaseActivity
import org.pixeldroid.app.utils.BaseThemedWithBarActivity
class AboutActivity : BaseActivity() {
class AboutActivity : BaseThemedWithBarActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val binding = ActivityAboutBinding.inflate(layoutInflater)

View File

@ -6,18 +6,19 @@ import org.pixeldroid.app.R
import org.pixeldroid.app.databinding.OpenSourceLicenseBinding
import org.pixeldroid.app.settings.licenseObjects.Libraries
import org.pixeldroid.app.settings.licenseObjects.OpenSourceItem
import org.pixeldroid.app.utils.BaseActivity
import java.io.FileNotFoundException
import org.pixeldroid.app.utils.BaseThemedWithBarActivity
import org.pixeldroid.app.utils.themeActionBar
/**
* Displays licenses for all app dependencies. JSON is
* generated by the plugin https://github.com/cookpad/LicenseToolsPlugin.
*/
class LicenseActivity: BaseActivity() {
class LicenseActivity: BaseThemedWithBarActivity() {
private lateinit var binding: OpenSourceLicenseBinding
override fun onCreate(savedInstanceState: Bundle?) {
setTheme(themeActionBar())
super.onCreate(savedInstanceState)
binding = OpenSourceLicenseBinding.inflate(layoutInflater)

View File

@ -4,15 +4,16 @@ import android.content.Intent
import android.content.SharedPreferences
import android.os.Build
import android.os.Bundle
import androidx.fragment.app.DialogFragment
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceManager
import org.pixeldroid.app.MainActivity
import org.pixeldroid.app.R
import org.pixeldroid.app.utils.BaseActivity
import org.pixeldroid.app.utils.BaseThemedWithBarActivity
import org.pixeldroid.app.utils.setThemeFromPreferences
class SettingsActivity : BaseActivity(), SharedPreferences.OnSharedPreferenceChangeListener {
class SettingsActivity : BaseThemedWithBarActivity(), SharedPreferences.OnSharedPreferenceChangeListener {
private var restartMainOnExit = false
override fun onCreate(savedInstanceState: Bundle?) {
@ -62,6 +63,9 @@ class SettingsActivity : BaseActivity(), SharedPreferences.OnSharedPreferenceCha
"language" -> {
recreateWithRestartStatus()
}
"themeColor" -> {
recreateWithRestartStatus()
}
}
}
@ -79,6 +83,19 @@ class SettingsActivity : BaseActivity(), SharedPreferences.OnSharedPreferenceCha
}
class SettingsFragment : PreferenceFragmentCompat() {
override fun onDisplayPreferenceDialog(preference: Preference) {
var dialogFragment: DialogFragment? = null
if (preference is ColorPreference) {
dialogFragment = ColorPreferenceDialog((preference as ColorPreference?)!!)
}
if (dialogFragment != null) {
dialogFragment.setTargetFragment(this, 0)
dialogFragment.show(parentFragmentManager, "settings_fragment")
} else {
super.onDisplayPreferenceDialog(preference)
}
}
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.root_preferences, rootKey)

View File

@ -0,0 +1,192 @@
package org.pixeldroid.app.settings
import android.content.Context
import android.content.res.ColorStateList
import android.content.res.TypedArray
import android.os.Bundle
import android.util.AttributeSet
import android.util.TypedValue
import android.view.LayoutInflater
import android.view.View
import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.LinearLayout
import androidx.annotation.ColorRes
import androidx.appcompat.app.AlertDialog
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import androidx.core.view.isVisible
import androidx.preference.DialogPreference
import androidx.preference.PreferenceDialogFragmentCompat
import androidx.preference.PreferenceViewHolder
import org.pixeldroid.app.R
import org.pixeldroid.app.databinding.ColorDialogBinding
/** Inspired by https://github.com/andstatus/todoagenda's color chooser.
* AndroidX version created by yvolk@yurivolkov.com
* based on this answer: https://stackoverflow.com/a/53290775/297710
* and on the code of https://github.com/koji-1009/ChronoDialogPreference
*/
class ColorPreferenceDialog(preference: ColorPreference) :
PreferenceDialogFragmentCompat() {
private val preference: ColorPreference
private var mPicker: ColorPickerView? = null
init {
this.preference = preference
val b = Bundle()
b.putString(ARG_KEY, preference.key)
arguments = b
}
override fun onCreateDialogView(context: Context): View? {
val picker = ColorPickerView(context)
preference.color?.let {
picker.color = it
}
mPicker = picker
return mPicker
}
override fun onPrepareDialogBuilder(builder: AlertDialog.Builder) {
if (preference.selectNoneButtonText != null) {
builder.setNeutralButton(preference.selectNoneButtonText, null)
}
}
override fun onDialogClosed(positiveResult: Boolean) {
if (positiveResult) {
val color: Int = mPicker!!.color
if (preference.callChangeListener(color)) {
preference.color = color
}
}
}
}
class ColorPreference constructor(context: Context, attrs: AttributeSet? = null) : DialogPreference(context, attrs) {
var selectNoneButtonText: String? = null
var defaultColor: Int? = null
private var thumbnail: View? = null
override fun onBindViewHolder(viewHolder: PreferenceViewHolder) {
thumbnail = addThumbnail(viewHolder.itemView)
showColor(persistedIntDefaultOrNull)
// Only call after showColor sets any summary text:
super.onBindViewHolder(viewHolder)
}
override fun onGetDefaultValue(a: TypedArray, index: Int): Any? {
defaultColor = readDefaultValue(a, index)
return defaultColor
}
override fun setDefaultValue(defaultValue: Any?) {
super.setDefaultValue(defaultValue)
defaultColor = parseDefaultValue(defaultValue)
}
override fun onSetInitialValue(defaultValue: Any?) {
color = defaultValue?.let {
parseDefaultValue(defaultValue)
} ?: color
}
private fun addThumbnail(view: View): View {
val widgetFrameView: LinearLayout = view.findViewById(android.R.id.widget_frame)
widgetFrameView.visibility = View.VISIBLE
widgetFrameView.removeAllViews()
LayoutInflater.from(context).inflate(R.layout.color_preference_thumbnail, widgetFrameView)
return widgetFrameView.findViewById(R.id.thumbnail)
}
private val persistedIntDefaultOrNull: Int
get() = if (shouldPersist() && sharedPreferences?.contains(key) == true)
Integer.valueOf(getPersistedInt(0)) else defaultColor!!
private fun showColor(color: Int?) {
val thumbColor = color ?: defaultColor
thumbnail?.visibility = if (thumbColor == null) View.GONE else View.VISIBLE
@ColorRes
val colorCode: Int = when(thumbColor){
1 -> R.color.seed2
2 -> R.color.seed3
3 -> R.color.seed4
else -> R.color.seed
}
thumbnail?.findViewById<ImageView>(R.id.colorPreview)?.imageTintList = ColorStateList.valueOf(
ContextCompat.getColor(context, colorCode)
)
}
private fun removeSetting() {
if (shouldPersist()) {
sharedPreferences
?.edit()
?.remove(key)
?.apply()
}
}
var color: Int?
get() = persistedIntDefaultOrNull
set(color) {
if (color == null) {
removeSetting()
} else {
persistInt(color)
}
showColor(color)
}
companion object {
private fun readDefaultValue(a: TypedArray, index: Int): Int? {
if (a.peekValue(index) != null) {
val type = a.peekValue(index).type
if (TypedValue.TYPE_FIRST_INT <= type && type <= TypedValue.TYPE_LAST_INT) {
return a.getInt(index, 0)
}
}
return null
}
private fun parseDefaultValue(defaultValue: Any?): Int {
return if (defaultValue == null) 0 else if (defaultValue is Int) defaultValue else 0
}
}
}
class ColorPickerView(context: Context?, attrs: AttributeSet? = null) : FrameLayout(context!!, attrs) {
var binding: ColorDialogBinding
init {
binding = ColorDialogBinding.inflate(LayoutInflater.from(context),this, true)
binding.theme1.setOnClickListener { color = 0 }
binding.theme2.setOnClickListener { color = 1 }
binding.theme3.setOnClickListener { color = 2 }
binding.theme4.setOnClickListener { color = 3 }
}
private fun changeConstraint(button2: View) {
binding.chosenTheme.isVisible = true
val params = binding.chosenTheme.layoutParams as ConstraintLayout.LayoutParams
params.endToEnd = button2.id
params.startToStart = button2.id
binding.chosenTheme.layoutParams = params
binding.chosenTheme.requestLayout()
}
/** Returns the color selected by the user */
/** Sets the original color swatch and the current color to the specified value. */
var color: Int = 0
set(value) {
field = value
when(value) {
0 -> binding.theme1
1 -> binding.theme2
2 -> binding.theme3
3 -> binding.theme4
else -> null
}?.let { changeConstraint(it) }
}
}

View File

@ -0,0 +1,10 @@
package org.pixeldroid.app.utils
import android.os.Bundle
open class BaseThemedWithBarActivity : BaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
setTheme(themeActionBar())
super.onCreate(savedInstanceState)
}
}

View File

@ -0,0 +1,10 @@
package org.pixeldroid.app.utils
import android.os.Bundle
open class BaseThemedWithoutBarActivity : BaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
setTheme(themeNoActionBar())
super.onCreate(savedInstanceState)
}
}

View File

@ -2,6 +2,7 @@ package org.pixeldroid.app.utils
import android.app.Application
import androidx.preference.PreferenceManager
import com.google.android.material.color.DynamicColors
import org.pixeldroid.app.utils.di.*
import com.mikepenz.iconics.Iconics
import org.ligi.tracedroid.TraceDroid
@ -26,6 +27,9 @@ class PixelDroidApplication: Application() {
.aPIModule(APIModule())
.build()
mApplicationComponent.inject(this)
//TODO put condition depending on setting to apply dynamic colours (android 12+)
if(false) DynamicColors.applyToActivitiesIfAvailable(this)
}
fun getAppComponent(): ApplicationComponent {

View File

@ -3,6 +3,7 @@ package org.pixeldroid.app.utils
import android.content.*
import android.content.res.Resources
import android.graphics.Bitmap
import android.graphics.Color
import android.graphics.ImageDecoder
import android.graphics.Matrix
import android.net.ConnectivityManager
@ -10,16 +11,22 @@ import android.net.Uri
import android.os.Build
import android.provider.MediaStore
import android.util.DisplayMetrics
import android.util.TypedValue
import android.view.WindowManager
import androidx.annotation.AttrRes
import androidx.annotation.ColorInt
import androidx.annotation.StyleRes
import androidx.appcompat.app.AppCompatDelegate
import androidx.browser.customtabs.CustomTabsIntent
import androidx.exifinterface.media.ExifInterface
import androidx.fragment.app.Fragment
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import androidx.preference.PreferenceManager
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.arthenica.ffmpegkit.FFmpegKitConfig
import com.google.android.material.color.MaterialColors
import okhttp3.HttpUrl
import org.pixeldroid.app.R
import kotlin.properties.ReadWriteProperty
@ -165,7 +172,7 @@ fun RecyclerView.limitedLengthSmoothScrollToPosition(targetItem: Int) {
/**
* @brief Updates the application's theme depending on the given preferences and resources
*/
fun setThemeFromPreferences(preferences: SharedPreferences, resources : Resources) {
fun setThemeFromPreferences(preferences: SharedPreferences, resources: Resources) {
val themes = resources.getStringArray(R.array.theme_values)
//Set the theme
when(preferences.getString("theme", "")) {
@ -187,6 +194,29 @@ fun setThemeFromPreferences(preferences: SharedPreferences, resources : Resource
}
}
@StyleRes
fun Context.themeNoActionBar(): Int {
return when(PreferenceManager.getDefaultSharedPreferences(this).getInt("themeColor", 0)) {
1 -> R.style.AppTheme2_NoActionBar
2 -> R.style.AppTheme3_NoActionBar
3 -> R.style.AppTheme4_NoActionBar
else -> R.style.AppTheme_NoActionBar
}
}
@StyleRes
fun Context.themeActionBar(): Int {
return when(PreferenceManager.getDefaultSharedPreferences(this).getInt("themeColor", 0)) {
1 -> R.style.AppTheme2
2 -> R.style.AppTheme3
3 -> R.style.AppTheme4
else -> R.style.AppTheme
}
}
@ColorInt
fun Context.getColorFromAttr(@AttrRes attrColor: Int): Int = MaterialColors.getColor(this, attrColor, Color.BLACK)
/**
* Delegated property to use in fragments to prevent memory leaks of bindings.
* This makes it unnecessary to set binding to null in onDestroyView.

View File

@ -5,5 +5,5 @@
android:viewportHeight="24">
<path
android:pathData="M20,8h-2.81c-0.45,-0.78 -1.07,-1.45 -1.82,-1.96L17,4.41 15.59,3l-2.17,2.17C12.96,5.06 12.49,5 12,5c-0.49,0 -0.96,0.06 -1.41,0.17L8.41,3 7,4.41l1.62,1.63C7.88,6.55 7.26,7.22 6.81,8L4,8v2h2.09c-0.05,0.33 -0.09,0.66 -0.09,1v1L4,12v2h2v1c0,0.34 0.04,0.67 0.09,1L4,16v2h2.81c1.04,1.79 2.97,3 5.19,3s4.15,-1.21 5.19,-3L20,18v-2h-2.09c0.05,-0.33 0.09,-0.66 0.09,-1v-1h2v-2h-2v-1c0,-0.34 -0.04,-0.67 -0.09,-1L20,10L20,8zM14,16h-4v-2h4v2zM14,12h-4v-2h4v2z"
android:fillColor="@color/colorDrawing"/>
android:fillColor="?attr/colorOnBackground"/>
</vector>

View File

@ -4,9 +4,9 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="@color/white" android:pathData="M12,12m-8,0a8,8 0,1 1,16 0a8,8 0,1 1,-16 0"/>
<path android:fillColor="?attr/colorOnPrimaryContainer" android:pathData="M12,12m-8,0a8,8 0,1 1,16 0a8,8 0,1 1,-16 0"/>
<path
android:fillColor="@color/colorButtonBg"
android:fillColor="?attr/colorPrimaryContainer"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM10,17l-5,-5 1.41,-1.41L10,14.17l7.59,-7.59L19,8l-9,9z"/>
</vector>

View File

@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:width="48dp"
android:height="48dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -5,5 +5,5 @@
android:viewportHeight="24">
<path
android:pathData="M12,10.9c-0.61,0 -1.1,0.49 -1.1,1.1s0.49,1.1 1.1,1.1c0.61,0 1.1,-0.49 1.1,-1.1s-0.49,-1.1 -1.1,-1.1zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM14.19,14.19L6,18l3.81,-8.19L18,6l-3.81,8.19z"
android:fillColor="@color/colorDrawing"/>
android:fillColor="?attr/colorOnBackground"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/>
</vector>

View File

@ -4,6 +4,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@color/colorDrawing"
android:fillColor="?attr/colorOnBackground"
android:pathData="M7.58,4.08L6.15,2.65C3.75,4.48 2.17,7.3 2.03,10.5h2c0.15,-2.65 1.51,-4.97 3.55,-6.42zM19.97,10.5h2c-0.15,-3.2 -1.73,-6.02 -4.12,-7.85l-1.42,1.43c2.02,1.45 3.39,3.77 3.54,6.42zM18,11c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2v-5zM12,22c0.14,0 0.27,-0.01 0.4,-0.04 0.65,-0.14 1.18,-0.58 1.44,-1.18 0.1,-0.24 0.15,-0.5 0.15,-0.78h-4c0.01,1.1 0.9,2 2.01,2z"/>
</vector>

View File

@ -4,6 +4,6 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/colorDrawing"
android:fillColor="?attr/colorOnBackground"
android:pathData="M17,15h2V7c0,-1.1 -0.9,-2 -2,-2H9v2h8v8zM7,17V1H5v4H1v2h4v10c0,1.1 0.9,2 2,2h10v4h2v-4h4v-2H7z"/>
</vector>

View File

@ -1,5 +0,0 @@
<vector android:height="12dp" android:tint="#003DFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="12dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#010101" android:pathData="M12,12m-8,0a8,8 0,1 1,16 0a8,8 0,1 1,-16 0"/>
</vector>

View File

@ -1,5 +0,0 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M9,16h6v-6h4l-7,-7 -7,7h4zM5,18h14v2L5,20z"/>
</vector>

View File

@ -4,6 +4,6 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/colorDrawing"
android:fillColor="?attr/colorOnBackground"
android:pathData="M15,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM6,10L6,7L4,7v3L1,10v2h3v3h2v-3h3v-2L6,10zM15,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>

View File

@ -1,4 +1,4 @@
<vector android:height="18dp" android:viewportHeight="512"
android:viewportWidth="512" android:width="18dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@color/colorDrawing" android:pathData="M462.3,62.6C407.5,15.9 326,24.3 275.7,76.2L256,96.5l-19.7,-20.3C186.1,24.3 104.5,15.9 49.7,62.6c-62.8,53.6 -66.1,149.8 -9.9,207.9l193.5,199.8c12.5,12.9 32.8,12.9 45.3,0l193.5,-199.8c56.3,-58.1 53,-154.3 -9.8,-207.9z"/>
<path android:fillColor="?attr/colorOnBackground" android:pathData="M462.3,62.6C407.5,15.9 326,24.3 275.7,76.2L256,96.5l-19.7,-20.3C186.1,24.3 104.5,15.9 49.7,62.6c-62.8,53.6 -66.1,149.8 -9.9,207.9l193.5,199.8c12.5,12.9 32.8,12.9 45.3,0l193.5,-199.8c56.3,-58.1 53,-154.3 -9.8,-207.9z"/>
</vector>

View File

@ -2,5 +2,5 @@
android:viewportWidth="110" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#00000000"
android:pathData="M54.5,94.5C58.2,90.74 79.39,69.25 92.63,55.83C104.5,43.8 104.24,26.26 93.46,15.39C82.67,4.5 65.23,4.55 54.5,15.48C43.76,4.55 26.32,4.5 15.54,15.38C4.75,26.25 4.5,43.79 16.36,55.83C29.6,69.25 50.79,90.74 54.5,94.5Z"
android:strokeColor="@color/colorDrawing" android:strokeWidth="9"/>
android:strokeColor="?attr/colorOnBackground" android:strokeWidth="9"/>
</vector>

View File

@ -2,14 +2,14 @@
android:viewportWidth="111" android:width="31.341177dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#00000000"
android:pathData="M30.5,64.5L90.5,64.5L90.5,39.81"
android:strokeColor="@color/colorDrawing" android:strokeWidth="9"/>
<path android:fillColor="@color/colorDrawing"
android:strokeColor="?attr/colorOnBackground" android:strokeWidth="9"/>
<path android:fillColor="?attr/colorOnBackground"
android:pathData="M90.5,25.56L100,44.56L90.5,39.81L81,44.56Z"
android:strokeColor="@color/colorDrawing" android:strokeWidth="9"/>
android:strokeColor="?attr/colorOnBackground" android:strokeWidth="9"/>
<path android:fillColor="#00000000"
android:pathData="M80.5,18.5L20.5,18.5L20.5,44.19"
android:strokeColor="@color/colorDrawing" android:strokeWidth="9"/>
<path android:fillColor="@color/colorDrawing"
android:strokeColor="?attr/colorOnBackground" android:strokeWidth="9"/>
<path android:fillColor="?attr/colorOnBackground"
android:pathData="M20.5,58.44L11,39.44L20.5,44.19L30,39.44Z"
android:strokeColor="@color/colorDrawing" android:strokeWidth="9"/>
android:strokeColor="?attr/colorOnBackground" android:strokeWidth="9"/>
</vector>

View File

@ -1,5 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
<vector android:height="24dp"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M17,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,7l-4,-4zM12,19c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3 3,1.34 3,3 -1.34,3 -3,3zM15,9L5,9L5,5h10v4z"/>
<path android:fillColor="?attr/colorOnSurface" android:pathData="M17,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,7l-4,-4zM12,19c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3 3,1.34 3,3 -1.34,3 -3,3zM15,9L5,9L5,5h10v4z"/>
</vector>

View File

@ -5,5 +5,5 @@
android:viewportHeight="24">
<path
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z"
android:fillColor="@color/colorDrawing"/>
android:fillColor="?attr/colorOnBackground"/>
</vector>

View File

@ -5,5 +5,5 @@
android:viewportHeight="24">
<path
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10h5v-2h-5c-4.34,0 -8,-3.66 -8,-8s3.66,-8 8,-8 8,3.66 8,8v1.43c0,0.79 -0.71,1.57 -1.5,1.57s-1.5,-0.78 -1.5,-1.57L17,12c0,-2.76 -2.24,-5 -5,-5s-5,2.24 -5,5 2.24,5 5,5c1.38,0 2.64,-0.56 3.54,-1.47 0.65,0.89 1.77,1.47 2.96,1.47 1.97,0 3.5,-1.6 3.5,-3.57L22,12c0,-5.52 -4.48,-10 -10,-10zM12,15c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3 3,1.34 3,3 -1.34,3 -3,3z"
android:fillColor="@color/colorDrawing"/>
android:fillColor="?attr/colorOnBackground"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,5.69l5,4.5V18h-2v-6H9v6H7v-7.81l5,-4.5M12,3L2,12h3v8h6v-6h2v6h6v-8h3L12,3z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.9,2 2,2zM18,16v-5c0,-3.07 -1.63,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.64,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2zM16,17L8,17v-6c0,-2.48 1.51,-4.5 4,-4.5s4,2.02 4,4.5v6z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M14.12,4l1.83,2L20,6v12L4,18L4,6h4.05l1.83,-2h4.24M15,2L9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2zM12,9c1.65,0 3,1.35 3,3s-1.35,3 -3,3 -3,-1.35 -3,-3 1.35,-3 3,-3m0,-2c-2.76,0 -5,2.24 -5,5s2.24,5 5,5 5,-2.24 5,-5 -2.24,-5 -5,-5z"/>
</vector>

View File

@ -5,5 +5,5 @@
android:viewportHeight="24">
<path
android:pathData="M12,3c-4.97,0 -9,4.03 -9,9s4.03,9 9,9c0.83,0 1.5,-0.67 1.5,-1.5 0,-0.39 -0.15,-0.74 -0.39,-1.01 -0.23,-0.26 -0.38,-0.61 -0.38,-0.99 0,-0.83 0.67,-1.5 1.5,-1.5L16,16c2.76,0 5,-2.24 5,-5 0,-4.42 -4.03,-8 -9,-8zM6.5,12c-0.83,0 -1.5,-0.67 -1.5,-1.5S5.67,9 6.5,9 8,9.67 8,10.5 7.33,12 6.5,12zM9.5,8C8.67,8 8,7.33 8,6.5S8.67,5 9.5,5s1.5,0.67 1.5,1.5S10.33,8 9.5,8zM14.5,8c-0.83,0 -1.5,-0.67 -1.5,-1.5S13.67,5 14.5,5s1.5,0.67 1.5,1.5S15.33,8 14.5,8zM17.5,12c-0.83,0 -1.5,-0.67 -1.5,-1.5S16.67,9 17.5,9s1.5,0.67 1.5,1.5 -0.67,1.5 -1.5,1.5z"
android:fillColor="@color/colorDrawing"/>
android:fillColor="?attr/colorOnBackground"/>
</vector>

View File

@ -5,5 +5,5 @@
android:viewportHeight="24">
<path
android:pathData="M19,3L5,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM9,17L7,17v-7h2v7zM13,17h-2L11,7h2v10zM17,17h-2v-4h2v4z"
android:fillColor="@color/colorDrawing"/>
android:fillColor="?attr/colorOnBackground"/>
</vector>

View File

@ -5,5 +5,5 @@
android:viewportHeight="24">
<path
android:pathData="M13,3c-4.97,0 -9,4.03 -9,9L1,12l3.89,3.89 0.07,0.14L9,12L6,12c0,-3.87 3.13,-7 7,-7s7,3.13 7,7 -3.13,7 -7,7c-1.93,0 -3.68,-0.79 -4.94,-2.06l-1.42,1.42C8.27,19.99 10.51,21 13,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zM12,8v5l4.28,2.54 0.72,-1.21 -3.5,-2.08L13.5,8L12,8z"
android:fillColor="#FFFFFF"/>
android:fillColor="?attr/colorOnSurface"/>
</vector>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/photo_camera" android:state_checked="true"/>
<item android:drawable="@drawable/outline_photo_camera" android:state_checked="false"/>
</selector>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_home_white_24dp" android:state_checked="true"/>
<item android:drawable="@drawable/outline_home" android:state_checked="false"/>
</selector>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/notifications" android:state_checked="true"/>
<item android:drawable="@drawable/outline_notifications" android:state_checked="false"/>
</selector>

View File

@ -5,5 +5,5 @@
android:viewportHeight="24">
<path
android:pathData="M12.87,15.07l-2.54,-2.51 0.03,-0.03c1.74,-1.94 2.98,-4.17 3.71,-6.53L17,6L17,4h-7L10,2L8,2v2L1,4v1.99h11.17C11.5,7.92 10.44,9.75 9,11.35 8.07,10.32 7.3,9.19 6.69,8h-2c0.73,1.63 1.73,3.17 2.98,4.56l-5.09,5.02L4,19l5,-5 3.11,3.11 0.76,-2.04zM18.5,10h-2L12,22h2l1.12,-3h4.75L21,22h2l-4.5,-12zM15.88,17l1.62,-4.33L19.12,17h-3.24z"
android:fillColor="@color/colorDrawing"/>
android:fillColor="?attr/colorOnBackground"/>
</vector>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="match_parent" android:layout_height="match_parent">
</WebView>

View File

@ -48,8 +48,6 @@
android:id="@+id/connect_instance_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="@color/colorButtonBg"
android:textColor="@color/colorButtonText"
android:text="@string/connect_to_pixelfed" />
<TextView

View File

@ -17,6 +17,7 @@
android:id="@+id/main_activity_main_linear_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@ -27,27 +28,23 @@
android:id="@+id/main_drawer_button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@color/colorPrimaryTab"
android:background="?attr/colorSurface"
android:contentDescription="@string/open_drawer_menu"
android:padding="12dp"
android:src="@drawable/ic_baseline_menu_24" />
<com.google.android.material.tabs.TabLayout
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/tabs"
app:elevation="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabBackground="@color/colorPrimaryTab"
app:tabGravity="fill"
app:tabMaxWidth="0dp"
app:tabMode="fixed"
app:tabUnboundedRipple="false" />
app:menu="@menu/bottom_navigation_main" />
</LinearLayout>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/view_pager"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
app:layout_constraintBottom_toTopOf="@+id/main_activity_main_linear_layout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"

View File

@ -79,7 +79,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="411dp"
android:backgroundTint="#FFFFFFFF"
android:src="@drawable/ic_crop_black_24dp"
app:layout_constraintLeft_toLeftOf="@+id/left_guideline"
app:layout_constraintRight_toRightOf="@+id/right_guideline"

View File

@ -22,24 +22,24 @@
android:id="@+id/upload_error_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#90000000"
android:background="?attr/colorError"
android:text="@string/media_upload_failed"
android:textColor="@color/colorPrimaryError"
android:textColor="?attr/colorOnError"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:drawableStartCompat="@drawable/cloud_off_24"
app:drawableTint="@color/colorPrimaryError" />
app:drawableTint="?attr/colorOnError" />
<TextView
android:id="@+id/upload_error_text_explanation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#90000000"
android:background="?attr/colorError"
tools:text="Error code returned by server: 413"
android:textColor="@color/colorPrimaryError"
android:textColor="?attr/colorOnError"
android:textSize="20sp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
@ -96,10 +96,8 @@
android:id="@+id/post_creation_send_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:backgroundTint="@color/colorButtonBg"
android:enabled="true"
android:text="@string/post"
android:textColor="@color/colorButtonText"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@ -136,9 +134,7 @@
app:counterEnabled="true"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:textColorHint="@color/colorPrimaryTab"
app:errorEnabled="true"
app:errorTextColor="@color/colorPrimaryError"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/buttonConstraints"
app:layout_constraintStart_toStartOf="parent">
@ -148,8 +144,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:ems="10"
android:inputType="textMultiLine"
android:textColor="@color/colorPrimary" />
android:inputType="textMultiLine" />
</com.google.android.material.textfield.TextInputLayout>

View File

@ -15,7 +15,6 @@
android:id="@+id/collapsing_toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<androidx.constraintlayout.widget.ConstraintLayout
@ -107,9 +106,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:backgroundTint="@color/colorButtonBg"
android:text="@string/follow"
android:textColor="@color/colorButtonText"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="@+id/profilePictureImageView"
app:layout_constraintEnd_toEndOf="parent"
@ -119,12 +116,9 @@
android:id="@+id/editButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgroundTint="@color/colorButtonBg"
android:text="@string/edit_profile"
android:textColor="@color/colorButtonText"
android:visibility="gone"
app:icon="@drawable/ic_baseline_open_in_browser_24"
app:iconTint="@color/colorButtonText"
app:layout_constraintBottom_toBottomOf="@+id/profilePictureImageView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/profilePictureImageView"

View File

@ -40,20 +40,49 @@
</com.google.android.material.textfield.TextInputLayout>
<com.mikepenz.iconics.view.IconicsButton
<Button
android:id="@+id/reportButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/report"
android:textColor="@color/colorText"
android:backgroundTint="@color/colorPrimary"
app:iconGravity="end"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.75" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:id="@+id/reportSuccess"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.75"
tools:visibility="visible">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/reportSuccessText"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:src="@drawable/check_circle_24"
android:contentDescription="@string/reported" />
<TextView
android:id="@+id/reportSuccessText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:text="@string/reported"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<ProgressBar
android:id="@+id/reportProgressBar"
style="?android:attr/progressBarStyle"

View File

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<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:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageButton
android:id="@+id/theme1"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/color_choice_button"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/theme2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/circle_black_24dp"
app:tint="@color/seed" />
<ImageButton
android:id="@+id/theme2"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/color_choice_button"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/theme3"
app:layout_constraintStart_toEndOf="@+id/theme1"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/circle_black_24dp"
app:tint="@color/seed2" />
<ImageButton
android:id="@+id/theme3"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/color_choice_button"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/theme4"
app:layout_constraintStart_toEndOf="@+id/theme2"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/circle_black_24dp"
app:tint="@color/seed3" />
<ImageButton
android:id="@+id/theme4"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/color_choice_button"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/theme3"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/circle_black_24dp"
app:tint="@color/seed4" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/chosenTheme"
android:layout_width="48dp"
android:layout_height="48dp"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/theme1"
app:layout_constraintStart_toStartOf="@id/theme1"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible">
<ImageView
android:id="@+id/chosenThemeOverlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/color_chosen"
app:srcCompat="@drawable/circle_black_24dp"
app:tint="#4D000000" />
<ImageView
android:id="@+id/chosenThemeCheckMark"
android:layout_width="24dp"
android:layout_height="24dp"
android:contentDescription="@string/color_chosen"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_baseline_check_24" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:id="@+id/thumbnail"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="42dp"
android:layout_height="42dp">
<ImageView
android:id="@+id/colorPreview"
android:layout_margin="1dp"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/circle_black_24dp"
app:tint="@color/seed" />
</FrameLayout>

View File

@ -22,7 +22,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/red_panda"
app:tint="@color/colorDrawing" />
app:tint="?attr/colorOnBackground" />
<TextView
android:id="@+id/error_text"

View File

@ -43,6 +43,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#4D000000"
android:backgroundTint="?attr/colorSurface"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="@+id/indicator"

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/page_1"
android:enabled="true"
android:icon="@drawable/selector_home_feed"
android:title="@string/home_feed"/>
<item
android:id="@+id/page_2"
android:enabled="true"
android:icon="@drawable/ic_search_white_24dp"
android:title="@string/search_discover_feed"/>
<item
android:id="@+id/page_3"
android:enabled="true"
android:icon="@drawable/selector_camera"
android:title="@string/create_feed"/>
<item
android:id="@+id/page_4"
android:enabled="true"
android:icon="@drawable/selector_notifications"
android:title="@string/notifications_feed"/>
<item
android:id="@+id/page_5"
android:enabled="true"
android:icon="@drawable/ic_filter_black_24dp"
android:title="@string/public_feed"/>
</menu>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#FFFFFF</color>
<color name="colorPrimaryTab">#6200EE</color>
<color name="colorText">#000000</color>
<color name="colorDrawing">#FFFFFF</color>
<color name="background">#000000</color>
</resources>

View File

@ -0,0 +1,121 @@
<resources>
<style name="AppTheme" parent="Theme.Material3.Dark">
<item name="colorPrimary">@color/md_theme_dark_primary</item>
<item name="colorOnPrimary">@color/md_theme_dark_onPrimary</item>
<item name="colorPrimaryContainer">@color/md_theme_dark_primaryContainer</item>
<item name="colorOnPrimaryContainer">@color/md_theme_dark_onPrimaryContainer</item>
<item name="colorSecondary">@color/md_theme_dark_secondary</item>
<item name="colorOnSecondary">@color/md_theme_dark_onSecondary</item>
<item name="colorSecondaryContainer">@color/md_theme_dark_secondaryContainer</item>
<item name="colorOnSecondaryContainer">@color/md_theme_dark_onSecondaryContainer</item>
<item name="colorTertiary">@color/md_theme_dark_tertiary</item>
<item name="colorOnTertiary">@color/md_theme_dark_onTertiary</item>
<item name="colorTertiaryContainer">@color/md_theme_dark_tertiaryContainer</item>
<item name="colorOnTertiaryContainer">@color/md_theme_dark_onTertiaryContainer</item>
<item name="colorError">@color/md_theme_dark_error</item>
<item name="colorErrorContainer">@color/md_theme_dark_errorContainer</item>
<item name="colorOnError">@color/md_theme_dark_onError</item>
<item name="colorOnErrorContainer">@color/md_theme_dark_onErrorContainer</item>
<item name="android:colorBackground">@color/md_theme_dark_background</item>
<item name="colorOnBackground">@color/md_theme_dark_onBackground</item>
<item name="colorSurface">@color/md_theme_dark_surface</item>
<item name="colorOnSurface">@color/md_theme_dark_onSurface</item>
<item name="colorSurfaceVariant">@color/md_theme_dark_surfaceVariant</item>
<item name="colorOnSurfaceVariant">@color/md_theme_dark_onSurfaceVariant</item>
<item name="colorOutline">@color/md_theme_dark_outline</item>
<item name="colorOnSurfaceInverse">@color/md_theme_dark_inverseOnSurface</item>
<item name="colorSurfaceInverse">@color/md_theme_dark_inverseSurface</item>
<item name="elevationOverlayColor">@color/md_theme_dark_surfaceTint</item>
<item name="colorPrimaryInverse">@color/md_theme_dark_inversePrimary</item>
</style>
<style name="AppTheme2" parent="Theme.Material3.Dark">
<item name="colorPrimary">@color/md_theme_dark_primary2</item>
<item name="colorOnPrimary">@color/md_theme_dark_onPrimary2</item>
<item name="colorPrimaryContainer">@color/md_theme_dark_primaryContainer2</item>
<item name="colorOnPrimaryContainer">@color/md_theme_dark_onPrimaryContainer2</item>
<item name="colorSecondary">@color/md_theme_dark_secondary2</item>
<item name="colorOnSecondary">@color/md_theme_dark_onSecondary2</item>
<item name="colorSecondaryContainer">@color/md_theme_dark_secondaryContainer2</item>
<item name="colorOnSecondaryContainer">@color/md_theme_dark_onSecondaryContainer2</item>
<item name="colorTertiary">@color/md_theme_dark_tertiary2</item>
<item name="colorOnTertiary">@color/md_theme_dark_onTertiary2</item>
<item name="colorTertiaryContainer">@color/md_theme_dark_tertiaryContainer2</item>
<item name="colorOnTertiaryContainer">@color/md_theme_dark_onTertiaryContainer2</item>
<item name="colorError">@color/md_theme_dark_error2</item>
<item name="colorOnError">@color/md_theme_dark_onError2</item>
<item name="colorErrorContainer">@color/md_theme_dark_errorContainer2</item>
<item name="colorOnErrorContainer">@color/md_theme_dark_onErrorContainer2</item>
<item name="android:colorBackground">@color/md_theme_dark_background2</item>
<item name="colorOnBackground">@color/md_theme_dark_onBackground2</item>
<item name="colorSurface">@color/md_theme_dark_surface2</item>
<item name="colorOnSurface">@color/md_theme_dark_onSurface2</item>
<item name="colorSurfaceVariant">@color/md_theme_dark_surfaceVariant2</item>
<item name="colorOnSurfaceVariant">@color/md_theme_dark_onSurfaceVariant2</item>
<item name="colorOutline">@color/md_theme_dark_outline2</item>
<item name="colorSurfaceInverse">@color/md_theme_dark_inverseSurface2</item>
<item name="colorOnSurfaceInverse">@color/md_theme_dark_inverseOnSurface2</item>
<item name="elevationOverlayColor">@color/md_theme_dark_surfaceTint2</item>
<item name="colorPrimaryInverse">@color/md_theme_dark_inversePrimary2</item>
</style>
<style name="AppTheme3" parent="Theme.Material3.Dark">
<item name="colorPrimary">@color/md_theme_dark_primary3</item>
<item name="colorOnPrimary">@color/md_theme_dark_onPrimary3</item>
<item name="colorPrimaryContainer">@color/md_theme_dark_primaryContainer3</item>
<item name="colorOnPrimaryContainer">@color/md_theme_dark_onPrimaryContainer3</item>
<item name="colorSecondary">@color/md_theme_dark_secondary3</item>
<item name="colorOnSecondary">@color/md_theme_dark_onSecondary3</item>
<item name="colorSecondaryContainer">@color/md_theme_dark_secondaryContainer3</item>
<item name="colorOnSecondaryContainer">@color/md_theme_dark_onSecondaryContainer3</item>
<item name="colorTertiary">@color/md_theme_dark_tertiary3</item>
<item name="colorOnTertiary">@color/md_theme_dark_onTertiary3</item>
<item name="colorTertiaryContainer">@color/md_theme_dark_tertiaryContainer3</item>
<item name="colorOnTertiaryContainer">@color/md_theme_dark_onTertiaryContainer3</item>
<item name="colorError">@color/md_theme_dark_error3</item>
<item name="colorOnError">@color/md_theme_dark_onError3</item>
<item name="colorErrorContainer">@color/md_theme_dark_errorContainer3</item>
<item name="colorOnErrorContainer">@color/md_theme_dark_onErrorContainer3</item>
<item name="android:colorBackground">@color/md_theme_dark_background3</item>
<item name="colorOnBackground">@color/md_theme_dark_onBackground3</item>
<item name="colorSurface">@color/md_theme_dark_surface3</item>
<item name="colorOnSurface">@color/md_theme_dark_onSurface3</item>
<item name="colorSurfaceVariant">@color/md_theme_dark_surfaceVariant3</item>
<item name="colorOnSurfaceVariant">@color/md_theme_dark_onSurfaceVariant3</item>
<item name="colorOutline">@color/md_theme_dark_outline3</item>
<item name="colorSurfaceInverse">@color/md_theme_dark_inverseSurface3</item>
<item name="colorOnSurfaceInverse">@color/md_theme_dark_inverseOnSurface3</item>
<item name="elevationOverlayColor">@color/md_theme_dark_surfaceTint3</item>
<item name="colorPrimaryInverse">@color/md_theme_dark_inversePrimary3</item>
</style>
<style name="AppTheme4" parent="Theme.Material3.Dark">
<item name="colorPrimary">@color/md_theme_dark_primary4</item>
<item name="colorOnPrimary">@color/md_theme_dark_onPrimary4</item>
<item name="colorPrimaryContainer">@color/md_theme_dark_primaryContainer4</item>
<item name="colorOnPrimaryContainer">@color/md_theme_dark_onPrimaryContainer4</item>
<item name="colorSecondary">@color/md_theme_dark_secondary4</item>
<item name="colorOnSecondary">@color/md_theme_dark_onSecondary4</item>
<item name="colorSecondaryContainer">@color/md_theme_dark_secondaryContainer4</item>
<item name="colorOnSecondaryContainer">@color/md_theme_dark_onSecondaryContainer4</item>
<item name="colorTertiary">@color/md_theme_dark_tertiary4</item>
<item name="colorOnTertiary">@color/md_theme_dark_onTertiary4</item>
<item name="colorTertiaryContainer">@color/md_theme_dark_tertiaryContainer4</item>
<item name="colorOnTertiaryContainer">@color/md_theme_dark_onTertiaryContainer4</item>
<item name="colorError">@color/md_theme_dark_error4</item>
<item name="colorOnError">@color/md_theme_dark_onError4</item>
<item name="colorErrorContainer">@color/md_theme_dark_errorContainer4</item>
<item name="colorOnErrorContainer">@color/md_theme_dark_onErrorContainer4</item>
<item name="android:colorBackground">@color/md_theme_dark_background4</item>
<item name="colorOnBackground">@color/md_theme_dark_onBackground4</item>
<item name="colorSurface">@color/md_theme_dark_surface4</item>
<item name="colorOnSurface">@color/md_theme_dark_onSurface4</item>
<item name="colorSurfaceVariant">@color/md_theme_dark_surfaceVariant4</item>
<item name="colorOnSurfaceVariant">@color/md_theme_dark_onSurfaceVariant4</item>
<item name="colorOutline">@color/md_theme_dark_outline4</item>
<item name="colorSurfaceInverse">@color/md_theme_dark_inverseSurface4</item>
<item name="colorOnSurfaceInverse">@color/md_theme_dark_inverseOnSurface4</item>
<item name="elevationOverlayColor">@color/md_theme_dark_surfaceTint4</item>
<item name="colorPrimaryInverse">@color/md_theme_dark_inversePrimary4</item>
</style>
</resources>

View File

@ -1,20 +1,251 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#6200EE</color>
<color name="colorPrimaryTab">#FFFFFF</color>
<color name="colorPrimaryActionBar">#6200EE</color>
<color name="colorPrimaryDark">#3700B3</color>
<color name="colorAccent">#03DAC5</color>
<color name="icActive">#FFFFFFFF</color>
<color name="icFocused">#DDFFFFFF</color>
<color name="icPressed">#AAFFFFFF</color>
<color name="colorButtonBg">#6200EE</color>
<color name="colorButtonText">#FFFFFF</color>
<color name="filterLabelNormal">#8A8889</color>
<color name="filterLabelSelected">#221F20</color>
<color name="colorPrimaryError">#FF0000</color>
<color name="colorText">#FFFFFF</color>
<color name="white">#FFFFFF</color>
<color name="colorDrawing">#000000</color>
<color name="background">#FFFFFF</color>
<!-- > Following are theme color values </-->
<color name="seed">#f4a261</color>
<color name="md_theme_light_primary">#924C00</color>
<color name="md_theme_light_onPrimary">#FFFFFF</color>
<color name="md_theme_light_primaryContainer">#FFDCC4</color>
<color name="md_theme_light_onPrimaryContainer">#2F1400</color>
<color name="md_theme_light_secondary">#745945</color>
<color name="md_theme_light_onSecondary">#FFFFFF</color>
<color name="md_theme_light_secondaryContainer">#FFDCC4</color>
<color name="md_theme_light_onSecondaryContainer">#2A1707</color>
<color name="md_theme_light_tertiary">#5D6136</color>
<color name="md_theme_light_onTertiary">#FFFFFF</color>
<color name="md_theme_light_tertiaryContainer">#E3E7AF</color>
<color name="md_theme_light_onTertiaryContainer">#1A1D00</color>
<color name="md_theme_light_error">#BA1A1A</color>
<color name="md_theme_light_errorContainer">#FFDAD6</color>
<color name="md_theme_light_onError">#FFFFFF</color>
<color name="md_theme_light_onErrorContainer">#410002</color>
<color name="md_theme_light_background">#FFFBFF</color>
<color name="md_theme_light_onBackground">#201A17</color>
<color name="md_theme_light_surface">#FFFBFF</color>
<color name="md_theme_light_onSurface">#201A17</color>
<color name="md_theme_light_surfaceVariant">#F3DFD2</color>
<color name="md_theme_light_onSurfaceVariant">#52443B</color>
<color name="md_theme_light_outline">#84746A</color>
<color name="md_theme_light_inverseOnSurface">#FBEEE8</color>
<color name="md_theme_light_inverseSurface">#362F2B</color>
<color name="md_theme_light_inversePrimary">#FFB780</color>
<color name="md_theme_light_shadow">#000000</color>
<color name="md_theme_light_surfaceTint">#924C00</color>
<color name="md_theme_light_surfaceTintColor">#924C00</color>
<color name="md_theme_dark_primary">#FFB780</color>
<color name="md_theme_dark_onPrimary">#4E2600</color>
<color name="md_theme_dark_primaryContainer">#6F3800</color>
<color name="md_theme_dark_onPrimaryContainer">#FFDCC4</color>
<color name="md_theme_dark_secondary">#E4BFA7</color>
<color name="md_theme_dark_onSecondary">#422B1A</color>
<color name="md_theme_dark_secondaryContainer">#5B412F</color>
<color name="md_theme_dark_onSecondaryContainer">#FFDCC4</color>
<color name="md_theme_dark_tertiary">#C6CA95</color>
<color name="md_theme_dark_onTertiary">#2F330C</color>
<color name="md_theme_dark_tertiaryContainer">#464A20</color>
<color name="md_theme_dark_onTertiaryContainer">#E3E7AF</color>
<color name="md_theme_dark_error">#FFB4AB</color>
<color name="md_theme_dark_errorContainer">#93000A</color>
<color name="md_theme_dark_onError">#690005</color>
<color name="md_theme_dark_onErrorContainer">#FFDAD6</color>
<color name="md_theme_dark_background">#201A17</color>
<color name="md_theme_dark_onBackground">#ECE0DA</color>
<color name="md_theme_dark_surface">#201A17</color>
<color name="md_theme_dark_onSurface">#ECE0DA</color>
<color name="md_theme_dark_surfaceVariant">#52443B</color>
<color name="md_theme_dark_onSurfaceVariant">#D6C3B7</color>
<color name="md_theme_dark_outline">#9F8D82</color>
<color name="md_theme_dark_inverseOnSurface">#201A17</color>
<color name="md_theme_dark_inverseSurface">#ECE0DA</color>
<color name="md_theme_dark_inversePrimary">#924C00</color>
<color name="md_theme_dark_shadow">#000000</color>
<color name="md_theme_dark_surfaceTint">#FFB780</color>
<color name="md_theme_dark_surfaceTintColor">#FFB780</color>
<color name="seed2">#4285F4</color>
<color name="md_theme_light_primary2">#005AC1</color>
<color name="md_theme_light_onPrimary2">#FFFFFF</color>
<color name="md_theme_light_primaryContainer2">#D8E2FF</color>
<color name="md_theme_light_onPrimaryContainer2">#001A41</color>
<color name="md_theme_light_secondary2">#535E78</color>
<color name="md_theme_light_onSecondary2">#FFFFFF</color>
<color name="md_theme_light_secondaryContainer2">#D8E2FF</color>
<color name="md_theme_light_onSecondaryContainer2">#0F1B32</color>
<color name="md_theme_light_tertiary2">#76517B</color>
<color name="md_theme_light_onTertiary2">#FFFFFF</color>
<color name="md_theme_light_tertiaryContainer2">#FED6FF</color>
<color name="md_theme_light_onTertiaryContainer2">#2D0E34</color>
<color name="md_theme_light_error2">#BA1A1A</color>
<color name="md_theme_light_onError2">#FFFFFF</color>
<color name="md_theme_light_errorContainer2">#FFDAD6</color>
<color name="md_theme_light_onErrorContainer2">#410002</color>
<color name="md_theme_light_background2">#FEFBFF</color>
<color name="md_theme_light_onBackground2">#1B1B1F</color>
<color name="md_theme_light_surface2">#FEFBFF</color>
<color name="md_theme_light_onSurface2">#1B1B1F</color>
<color name="md_theme_light_surfaceVariant2">#E1E2EC</color>
<color name="md_theme_light_onSurfaceVariant2">#44474F</color>
<color name="md_theme_light_outline2">#74777F</color>
<color name="md_theme_light_shadow2">#000000</color>
<color name="md_theme_light_inverseSurface2">#303033</color>
<color name="md_theme_light_inverseOnSurface2">#F2F0F4</color>
<color name="md_theme_light_inversePrimary2">#ADC6FF</color>
<color name="md_theme_light_surfaceTint2">#005AC1</color>
<color name="md_theme_light_surfaceTintColor2">#005AC1</color>
<color name="md_theme_dark_primary2">#ADC6FF</color>
<color name="md_theme_dark_onPrimary2">#002E69</color>
<color name="md_theme_dark_primaryContainer2">#004494</color>
<color name="md_theme_dark_onPrimaryContainer2">#D8E2FF</color>
<color name="md_theme_dark_secondary2">#BBC6E4</color>
<color name="md_theme_dark_onSecondary2">#253048</color>
<color name="md_theme_dark_secondaryContainer2">#3B475F</color>
<color name="md_theme_dark_onSecondaryContainer2">#D8E2FF</color>
<color name="md_theme_dark_tertiary2">#E5B8E8</color>
<color name="md_theme_dark_onTertiary2">#44244A</color>
<color name="md_theme_dark_tertiaryContainer2">#5D3A62</color>
<color name="md_theme_dark_onTertiaryContainer2">#FED6FF</color>
<color name="md_theme_dark_error2">#FFB4AB</color>
<color name="md_theme_dark_onError2">#690005</color>
<color name="md_theme_dark_errorContainer2">#93000A</color>
<color name="md_theme_dark_onErrorContainer2">#FFB4AB</color>
<color name="md_theme_dark_background2">#1B1B1F</color>
<color name="md_theme_dark_onBackground2">#E3E2E6</color>
<color name="md_theme_dark_surface2">#1B1B1F</color>
<color name="md_theme_dark_onSurface2">#E3E2E6</color>
<color name="md_theme_dark_surfaceVariant2">#44474F</color>
<color name="md_theme_dark_onSurfaceVariant2">#C4C6D0</color>
<color name="md_theme_dark_outline2">#8E9099</color>
<color name="md_theme_dark_shadow2">#000000</color>
<color name="md_theme_dark_inverseSurface2">#E3E2E6</color>
<color name="md_theme_dark_inverseOnSurface2">#303033</color>
<color name="md_theme_dark_inversePrimary2">#005AC1</color>
<color name="md_theme_dark_surfaceTint2">#ADC6FF</color>
<color name="md_theme_dark_surfaceTintColor2">#ADC6FF</color>
<color name="seed3">#fbd900</color>
<color name="md_theme_light_primary3">#6E5E00</color>
<color name="md_theme_light_onPrimary3">#FFFFFF</color>
<color name="md_theme_light_primaryContainer3">#FFE254</color>
<color name="md_theme_light_onPrimaryContainer3">#211B00</color>
<color name="md_theme_light_secondary3">#006A69</color>
<color name="md_theme_light_onSecondary3">#FFFFFF</color>
<color name="md_theme_light_secondaryContainer3">#6FF7F5</color>
<color name="md_theme_light_onSecondaryContainer3">#002020</color>
<color name="md_theme_light_tertiary3">#43664F</color>
<color name="md_theme_light_onTertiary3">#FFFFFF</color>
<color name="md_theme_light_tertiaryContainer3">#C4ECCF</color>
<color name="md_theme_light_onTertiaryContainer3">#002110</color>
<color name="md_theme_light_error3">#BA1A1A</color>
<color name="md_theme_light_errorContainer3">#FFDAD6</color>
<color name="md_theme_light_onError3">#FFFFFF</color>
<color name="md_theme_light_onErrorContainer3">#410002</color>
<color name="md_theme_light_background3">#FFFBFF</color>
<color name="md_theme_light_onBackground3">#1D1B16</color>
<color name="md_theme_light_surface3">#FFFBFF</color>
<color name="md_theme_light_onSurface3">#1D1B16</color>
<color name="md_theme_light_surfaceVariant3">#E9E2D0</color>
<color name="md_theme_light_onSurfaceVariant3">#4B4739</color>
<color name="md_theme_light_outline3">#7C7768</color>
<color name="md_theme_light_inverseOnSurface3">#F6F0E7</color>
<color name="md_theme_light_inverseSurface3">#32302A</color>
<color name="md_theme_light_inversePrimary3">#E4C500</color>
<color name="md_theme_light_shadow3">#000000</color>
<color name="md_theme_light_surfaceTint3">#6E5E00</color>
<color name="md_theme_light_surfaceTintColor3">#6E5E00</color>
<color name="md_theme_dark_primary3">#E4C500</color>
<color name="md_theme_dark_onPrimary3">#393000</color>
<color name="md_theme_dark_primaryContainer3">#534600</color>
<color name="md_theme_dark_onPrimaryContainer3">#FFE254</color>
<color name="md_theme_dark_secondary3">#4DDAD8</color>
<color name="md_theme_dark_onSecondary3">#003736</color>
<color name="md_theme_dark_secondaryContainer3">#00504F</color>
<color name="md_theme_dark_onSecondaryContainer3">#6FF7F5</color>
<color name="md_theme_dark_tertiary3">#A9D0B4</color>
<color name="md_theme_dark_onTertiary3">#143723</color>
<color name="md_theme_dark_tertiaryContainer3">#2B4E38</color>
<color name="md_theme_dark_onTertiaryContainer3">#C4ECCF</color>
<color name="md_theme_dark_error3">#FFB4AB</color>
<color name="md_theme_dark_errorContainer3">#93000A</color>
<color name="md_theme_dark_onError3">#690005</color>
<color name="md_theme_dark_onErrorContainer3">#FFDAD6</color>
<color name="md_theme_dark_background3">#1D1B16</color>
<color name="md_theme_dark_onBackground3">#E7E2D9</color>
<color name="md_theme_dark_surface3">#1D1B16</color>
<color name="md_theme_dark_onSurface3">#E7E2D9</color>
<color name="md_theme_dark_surfaceVariant3">#4B4739</color>
<color name="md_theme_dark_onSurfaceVariant3">#CDC6B4</color>
<color name="md_theme_dark_outline3">#969080</color>
<color name="md_theme_dark_inverseOnSurface3">#1D1B16</color>
<color name="md_theme_dark_inverseSurface3">#E7E2D9</color>
<color name="md_theme_dark_inversePrimary3">#6E5E00</color>
<color name="md_theme_dark_shadow3">#000000</color>
<color name="md_theme_dark_surfaceTint3">#E4C500</color>
<color name="md_theme_dark_surfaceTintColor3">#E4C500</color>
<color name="seed4">#984061</color>
<color name="md_theme_light_primary4">#984061</color>
<color name="md_theme_light_onPrimary4">#FFFFFF</color>
<color name="md_theme_light_primaryContainer4">#FFD9E2</color>
<color name="md_theme_light_onPrimaryContainer4">#3E001D</color>
<color name="md_theme_light_secondary4">#74565F</color>
<color name="md_theme_light_onSecondary4">#FFFFFF</color>
<color name="md_theme_light_secondaryContainer4">#FFD9E2</color>
<color name="md_theme_light_onSecondaryContainer4">#2B151C</color>
<color name="md_theme_light_tertiary4">#7C5635</color>
<color name="md_theme_light_onTertiary4">#FFFFFF</color>
<color name="md_theme_light_tertiaryContainer4">#FFDCC2</color>
<color name="md_theme_light_onTertiaryContainer4">#2E1500</color>
<color name="md_theme_light_error4">#BA1A1A</color>
<color name="md_theme_light_errorContainer4">#FFDAD6</color>
<color name="md_theme_light_onError4">#FFFFFF</color>
<color name="md_theme_light_onErrorContainer4">#410002</color>
<color name="md_theme_light_background4">#FFFBFF</color>
<color name="md_theme_light_onBackground4">#201A1B</color>
<color name="md_theme_light_surface4">#FFFBFF</color>
<color name="md_theme_light_onSurface4">#201A1B</color>
<color name="md_theme_light_surfaceVariant4">#F2DDE2</color>
<color name="md_theme_light_onSurfaceVariant4">#514347</color>
<color name="md_theme_light_outline4">#837377</color>
<color name="md_theme_light_inverseOnSurface4">#FAEEEF</color>
<color name="md_theme_light_inverseSurface4">#352F30</color>
<color name="md_theme_light_inversePrimary4">#FFB0C8</color>
<color name="md_theme_light_shadow4">#000000</color>
<color name="md_theme_light_surfaceTint4">#984061</color>
<color name="md_theme_light_surfaceTintColor4">#984061</color>
<color name="md_theme_dark_primary4">#FFB0C8</color>
<color name="md_theme_dark_onPrimary4">#5E1133</color>
<color name="md_theme_dark_primaryContainer4">#7B2949</color>
<color name="md_theme_dark_onPrimaryContainer4">#FFD9E2</color>
<color name="md_theme_dark_secondary4">#E2BDC6</color>
<color name="md_theme_dark_onSecondary4">#422931</color>
<color name="md_theme_dark_secondaryContainer4">#5A3F47</color>
<color name="md_theme_dark_onSecondaryContainer4">#FFD9E2</color>
<color name="md_theme_dark_tertiary4">#EFBD94</color>
<color name="md_theme_dark_onTertiary4">#48290C</color>
<color name="md_theme_dark_tertiaryContainer4">#623F20</color>
<color name="md_theme_dark_onTertiaryContainer4">#FFDCC2</color>
<color name="md_theme_dark_error4">#FFB4AB</color>
<color name="md_theme_dark_errorContainer4">#93000A</color>
<color name="md_theme_dark_onError4">#690005</color>
<color name="md_theme_dark_onErrorContainer4">#FFDAD6</color>
<color name="md_theme_dark_background4">#201A1B</color>
<color name="md_theme_dark_onBackground4">#EBE0E1</color>
<color name="md_theme_dark_surface4">#201A1B</color>
<color name="md_theme_dark_onSurface4">#EBE0E1</color>
<color name="md_theme_dark_surfaceVariant4">#514347</color>
<color name="md_theme_dark_onSurfaceVariant4">#D5C2C6</color>
<color name="md_theme_dark_outline4">#9E8C90</color>
<color name="md_theme_dark_inverseOnSurface4">#201A1B</color>
<color name="md_theme_dark_inverseSurface4">#EBE0E1</color>
<color name="md_theme_dark_inversePrimary4">#984061</color>
<color name="md_theme_dark_shadow4">#000000</color>
<color name="md_theme_dark_surfaceTint4">#FFB0C8</color>
<color name="md_theme_dark_surfaceTintColor4">#FFB0C8</color>
</resources>

View File

@ -105,7 +105,7 @@ For more info about Pixelfed, you can check here: https://pixelfed.org"</string>
<string name="upload_post_success">Post uploaded successfully</string>
<string name="upload_post_error">Post upload error</string>
<string name="description">Description…</string>
<string name="post">post</string>
<string name="post">Post</string>
<string name="add_photo">Add a photo</string>
<string name="post_image">One of the images in the post</string>
<string name="switch_to_grid">Switch to grid view</string>
@ -212,9 +212,9 @@ For more info about Pixelfed, you can check here: https://pixelfed.org"</string>
<string name="hashtags">HASHTAGS</string>
<!-- Sensitive media -->
<string name="cw_nsfw_hidden_media_n_click_to_show">CW / NSFW / Hidden Media\n (click to show)</string>
<!-- Shown when image has finished uploading. {gmd_cloud_done} is an icon, position it as is appropriate in target language -->
<!-- Shown when image has finished uploading.-->
<string name="media_upload_completed">Media upload completed</string>
<!-- Shown when image uploading has failed. {gmd_cloud_off} is an icon, position it as is appropriate in target language -->
<!-- Shown when image uploading has failed.-->
<string name="media_upload_failed">Media upload failed, try again or check network conditions</string>
<string name="posting_image_accessibility_hint">Image that is being posted</string>
<string name="retry">Retry</string>
@ -234,8 +234,7 @@ For more info about Pixelfed, you can check here: https://pixelfed.org"</string>
<string name="share_link">Share Link</string>
<string name="optional_report_comment">Optional message for mods/admins</string>
<string name="report_target">Report @%1$s\'s post</string>
<!-- Text on button, shown when report was successful. {gmd_check_circle} is an icon, position it as is appropriate in target language -->
<string name="reported">Reported {gmd_check_circle}</string>
<string name="reported">Post reported</string>
<string name="report_error">Could not send report</string>
<string name="toolbar_title_edit">Edit</string>
<string name="profile_picture">Profile picture</string>
@ -274,4 +273,13 @@ For more info about Pixelfed, you can check here: https://pixelfed.org"</string>
<string name="new_post_shortcut_short">New post</string>
<string name="follow_request">%1$s requests to follow you</string>
<string name="status_notification">%1$s created a post</string>
<string name="home_feed">Home</string>
<string name="search_discover_feed">Search</string>
<string name="create_feed">Create</string>
<string name="notifications_feed">Updates</string>
<string name="public_feed">Public</string>
<string name="accentColorTitle">Color accent</string>
<string name="accentColorSummary">Choose a color accent</string>
<string name="color_choice_button">Choose this color accent</string>
<string name="color_chosen">Chosen color accent</string>
</resources>

View File

@ -1,25 +1,13 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="actionBarTheme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
</style>
<style name="AppTheme.Launcher">
<item name="android:windowBackground">@drawable/theme</item>
<item name="colorPrimaryDark">?android:attr/colorBackground</item>
</style>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="posts_title">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_marginBottom">8dp</item>
<item name="android:paddingLeft">8dp</item>
<item name="android:background">@android:color/holo_orange_light</item>
<item name="android:textAppearance">@android:style/TextAppearance.Large</item>
</style>
<style name="AppTheme.PopupOverlay" parent="Theme.Material3.Light" />
<style name="AppTheme.ActionBar.Transparent" parent="AppTheme">
<item name="colorPrimary">@android:color/transparent</item>
@ -38,4 +26,140 @@
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme2.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme3.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme4.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme" parent="Theme.Material3.Light">
<item name="materialDrawerStyle">@style/Widget.MaterialDrawerStyle</item>
<item name="materialDrawerHeaderStyle">@style/Widget.MaterialDrawerHeaderStyle</item>
<item name="colorPrimary">@color/md_theme_light_primary</item>
<item name="colorOnPrimary">@color/md_theme_light_onPrimary</item>
<item name="colorPrimaryContainer">@color/md_theme_light_primaryContainer</item>
<item name="colorOnPrimaryContainer">@color/md_theme_light_onPrimaryContainer</item>
<item name="colorSecondary">@color/md_theme_light_secondary</item>
<item name="colorOnSecondary">@color/md_theme_light_onSecondary</item>
<item name="colorSecondaryContainer">@color/md_theme_light_secondaryContainer</item>
<item name="colorOnSecondaryContainer">@color/md_theme_light_onSecondaryContainer</item>
<item name="colorTertiary">@color/md_theme_light_tertiary</item>
<item name="colorOnTertiary">@color/md_theme_light_onTertiary</item>
<item name="colorTertiaryContainer">@color/md_theme_light_tertiaryContainer</item>
<item name="colorOnTertiaryContainer">@color/md_theme_light_onTertiaryContainer</item>
<item name="colorError">@color/md_theme_light_error</item>
<item name="colorErrorContainer">@color/md_theme_light_errorContainer</item>
<item name="colorOnError">@color/md_theme_light_onError</item>
<item name="colorOnErrorContainer">@color/md_theme_light_onErrorContainer</item>
<item name="android:colorBackground">@color/md_theme_light_background</item>
<item name="colorOnBackground">@color/md_theme_light_onBackground</item>
<item name="colorSurface">@color/md_theme_light_surface</item>
<item name="colorOnSurface">@color/md_theme_light_onSurface</item>
<item name="colorSurfaceVariant">@color/md_theme_light_surfaceVariant</item>
<item name="colorOnSurfaceVariant">@color/md_theme_light_onSurfaceVariant</item>
<item name="colorOutline">@color/md_theme_light_outline</item>
<item name="colorOnSurfaceInverse">@color/md_theme_light_inverseOnSurface</item>
<item name="colorSurfaceInverse">@color/md_theme_light_inverseSurface</item>
<item name="elevationOverlayColor">@color/md_theme_light_surfaceTint</item>
<item name="colorPrimaryInverse">@color/md_theme_light_inversePrimary</item>
</style>
<style name="AppTheme2" parent="Theme.Material3.Light">
<item name="colorPrimary">@color/md_theme_light_primary2</item>
<item name="colorOnPrimary">@color/md_theme_light_onPrimary2</item>
<item name="colorPrimaryContainer">@color/md_theme_light_primaryContainer2</item>
<item name="colorOnPrimaryContainer">@color/md_theme_light_onPrimaryContainer2</item>
<item name="colorSecondary">@color/md_theme_light_secondary2</item>
<item name="colorOnSecondary">@color/md_theme_light_onSecondary2</item>
<item name="colorSecondaryContainer">@color/md_theme_light_secondaryContainer2</item>
<item name="colorOnSecondaryContainer">@color/md_theme_light_onSecondaryContainer2</item>
<item name="colorTertiary">@color/md_theme_light_tertiary2</item>
<item name="colorOnTertiary">@color/md_theme_light_onTertiary2</item>
<item name="colorTertiaryContainer">@color/md_theme_light_tertiaryContainer2</item>
<item name="colorOnTertiaryContainer">@color/md_theme_light_onTertiaryContainer2</item>
<item name="colorError">@color/md_theme_light_error2</item>
<item name="colorOnError">@color/md_theme_light_onError2</item>
<item name="colorErrorContainer">@color/md_theme_light_errorContainer2</item>
<item name="colorOnErrorContainer">@color/md_theme_light_onErrorContainer2</item>
<item name="android:colorBackground">@color/md_theme_light_background2</item>
<item name="colorOnBackground">@color/md_theme_light_onBackground2</item>
<item name="colorSurface">@color/md_theme_light_surface2</item>
<item name="colorOnSurface">@color/md_theme_light_onSurface2</item>
<item name="colorSurfaceVariant">@color/md_theme_light_surfaceVariant2</item>
<item name="colorOnSurfaceVariant">@color/md_theme_light_onSurfaceVariant2</item>
<item name="colorOutline">@color/md_theme_light_outline2</item>
<item name="colorSurfaceInverse">@color/md_theme_light_inverseSurface2</item>
<item name="colorOnSurfaceInverse">@color/md_theme_light_inverseOnSurface2</item>
<item name="elevationOverlayColor">@color/md_theme_light_surfaceTint2</item>
<item name="colorPrimaryInverse">@color/md_theme_light_inversePrimary2</item>
</style>
<style name="AppTheme3" parent="Theme.Material3.Light">
<item name="colorPrimary">@color/md_theme_light_primary3</item>
<item name="colorOnPrimary">@color/md_theme_light_onPrimary3</item>
<item name="colorPrimaryContainer">@color/md_theme_light_primaryContainer3</item>
<item name="colorOnPrimaryContainer">@color/md_theme_light_onPrimaryContainer3</item>
<item name="colorSecondary">@color/md_theme_light_secondary3</item>
<item name="colorOnSecondary">@color/md_theme_light_onSecondary3</item>
<item name="colorSecondaryContainer">@color/md_theme_light_secondaryContainer3</item>
<item name="colorOnSecondaryContainer">@color/md_theme_light_onSecondaryContainer3</item>
<item name="colorTertiary">@color/md_theme_light_tertiary3</item>
<item name="colorOnTertiary">@color/md_theme_light_onTertiary3</item>
<item name="colorTertiaryContainer">@color/md_theme_light_tertiaryContainer3</item>
<item name="colorOnTertiaryContainer">@color/md_theme_light_onTertiaryContainer3</item>
<item name="colorError">@color/md_theme_light_error3</item>
<item name="colorOnError">@color/md_theme_light_onError3</item>
<item name="colorErrorContainer">@color/md_theme_light_errorContainer3</item>
<item name="colorOnErrorContainer">@color/md_theme_light_onErrorContainer3</item>
<item name="android:colorBackground">@color/md_theme_light_background3</item>
<item name="colorOnBackground">@color/md_theme_light_onBackground3</item>
<item name="colorSurface">@color/md_theme_light_surface3</item>
<item name="colorOnSurface">@color/md_theme_light_onSurface3</item>
<item name="colorSurfaceVariant">@color/md_theme_light_surfaceVariant3</item>
<item name="colorOnSurfaceVariant">@color/md_theme_light_onSurfaceVariant3</item>
<item name="colorOutline">@color/md_theme_light_outline3</item>
<item name="colorSurfaceInverse">@color/md_theme_light_inverseSurface3</item>
<item name="colorOnSurfaceInverse">@color/md_theme_light_inverseOnSurface3</item>
<item name="elevationOverlayColor">@color/md_theme_light_surfaceTint3</item>
<item name="colorPrimaryInverse">@color/md_theme_light_inversePrimary3</item>
</style>
<style name="AppTheme4" parent="Theme.Material3.Light">
<item name="colorPrimary">@color/md_theme_light_primary4</item>
<item name="colorOnPrimary">@color/md_theme_light_onPrimary4</item>
<item name="colorPrimaryContainer">@color/md_theme_light_primaryContainer4</item>
<item name="colorOnPrimaryContainer">@color/md_theme_light_onPrimaryContainer4</item>
<item name="colorSecondary">@color/md_theme_light_secondary4</item>
<item name="colorOnSecondary">@color/md_theme_light_onSecondary4</item>
<item name="colorSecondaryContainer">@color/md_theme_light_secondaryContainer4</item>
<item name="colorOnSecondaryContainer">@color/md_theme_light_onSecondaryContainer4</item>
<item name="colorTertiary">@color/md_theme_light_tertiary4</item>
<item name="colorOnTertiary">@color/md_theme_light_onTertiary4</item>
<item name="colorTertiaryContainer">@color/md_theme_light_tertiaryContainer4</item>
<item name="colorOnTertiaryContainer">@color/md_theme_light_onTertiaryContainer4</item>
<item name="colorError">@color/md_theme_light_error4</item>
<item name="colorOnError">@color/md_theme_light_onError4</item>
<item name="colorErrorContainer">@color/md_theme_light_errorContainer4</item>
<item name="colorOnErrorContainer">@color/md_theme_light_onErrorContainer4</item>
<item name="android:colorBackground">@color/md_theme_light_background4</item>
<item name="colorOnBackground">@color/md_theme_light_onBackground4</item>
<item name="colorSurface">@color/md_theme_light_surface4</item>
<item name="colorOnSurface">@color/md_theme_light_onSurface4</item>
<item name="colorSurfaceVariant">@color/md_theme_light_surfaceVariant4</item>
<item name="colorOnSurfaceVariant">@color/md_theme_light_onSurfaceVariant4</item>
<item name="colorOutline">@color/md_theme_light_outline4</item>
<item name="colorSurfaceInverse">@color/md_theme_light_inverseSurface4</item>
<item name="colorOnSurfaceInverse">@color/md_theme_light_inverseOnSurface4</item>
<item name="elevationOverlayColor">@color/md_theme_light_surfaceTint4</item>
<item name="colorPrimaryInverse">@color/md_theme_light_inversePrimary4</item>
</style>
</resources>

View File

@ -10,6 +10,12 @@
app:title="@string/theme_title"
app:useSimpleSummaryProvider="true"
app:icon="@drawable/palette_black_24dp"/>
<org.pixeldroid.app.settings.ColorPreference
android:title="@string/accentColorTitle"
android:key="themeColor"
android:defaultValue="0"
android:summary="@string/accentColorSummary" />
</PreferenceCategory>
<ListPreference

View File

@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.6.21'
ext.kotlin_version = '1.7.0'
repositories {
google()
mavenCentral()

View File

@ -0,0 +1,4 @@
* Add gson proguard rules to fix crashes on Mastodon instances
* Add color theming with 4 different themes
* Move to Material 3
* Improve consistency of the UI